diff --git a/GCC/CMakeLists.txt b/GCC/CMakeLists.txt index 7543a88..c1f5b5f 100644 --- a/GCC/CMakeLists.txt +++ b/GCC/CMakeLists.txt @@ -1,7 +1,5 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) PROJECT(GCC C) -IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) IF(GCCXML_INSTALL_COMPONENT_NAME_RUNTIME_EXECUTABLE) SET(GCCXML_INSTALL_COMPONENT_RUNTIME_EXECUTABLE diff --git a/GCC/config_cmake/gcc_platform.sh b/GCC/config_cmake/gcc_platform.sh index 6dc7e45..49dd175 100644 --- a/GCC/config_cmake/gcc_platform.sh +++ b/GCC/config_cmake/gcc_platform.sh @@ -50,7 +50,7 @@ SET(extra_objs ${extra_objs}) SET(extra_options ${extra_options}) SET(c_target_objs ${c_target_objs}) SET(cxx_target_objs ${cxx_target_objs}) -SET(target_cpu_default ${target_cpu_default}) +SET(target_cpu_default "${target_cpu_default}") SET(out_host_hook_obj ${out_host_hook_obj}) EOF diff --git a/GCC/gcc/cp/xml.c b/GCC/gcc/cp/xml.c index a765217..05acfa6 100644 --- a/GCC/gcc/cp/xml.c +++ b/GCC/gcc/cp/xml.c @@ -65,7 +65,7 @@ along with this program; if not, write to the #include "toplev.h" /* ident_hash */ -#define GCC_XML_C_VERSION "$Revision: 1.134 $" +#define GCC_XML_C_VERSION "$Revision: 1.135 $" /*--------------------------------------------------------------------------*/ /* Data structures for the actual XML dump. */ @@ -1096,13 +1096,24 @@ xml_print_static_method_attribute (xml_dump_info_p xdi, tree fd) } static void -xml_document_add_attribute_static_method(xml_document_element_p element) +xml_document_add_attribute_static(xml_document_element_p element) { xml_document_add_attribute(element, "static", xml_document_attribute_type_boolean, xml_document_attribute_use_optional, "0"); } +/*--------------------------------------------------------------------------*/ +/* Print XML attribute static="1" for static functions and variables. */ +static void +xml_print_static_attribute (xml_dump_info_p xdi, tree fd) +{ + if (DECL_THIS_STATIC (fd)) + { + fprintf (xdi->file, " static=\"1\""); + } +} + /*--------------------------------------------------------------------------*/ static int xml_print_overrides_r (xml_dump_info_p xdi, tree type, tree fndecl); @@ -1880,7 +1891,8 @@ xml_output_function_decl (xml_dump_info_p xdi, tree fd, xml_dump_node_p dn) int do_returns = 0; int do_const = 0; int do_virtual = 0; - int do_static = 0; + int do_static_method = 0; + int do_static_function = 0; int do_artificial = 0; int do_explicit = 0; @@ -1916,14 +1928,14 @@ xml_output_function_decl (xml_dump_info_p xdi, tree fd, xml_dump_node_p dn) tag = "OperatorMethod"; name = xml_reverse_opname_lookup (DECL_NAME (fd)); do_returns = 1; do_const = 1; do_virtual = 1; - do_static = 1; do_artificial = 1; + do_static_method = 1; do_artificial = 1; } else { /* An operator in a namespace. */ tag = "OperatorFunction"; name = xml_reverse_opname_lookup (DECL_NAME (fd)); - do_returns = 1; + do_static_function= 1; do_returns = 1; } } } @@ -1933,12 +1945,12 @@ xml_output_function_decl (xml_dump_info_p xdi, tree fd, xml_dump_node_p dn) { /* A member of a class. */ tag = "Method"; do_returns = 1; do_const = 1; - do_virtual = 1; do_static = 1; + do_virtual = 1; do_static_method = 1; } else { /* A member of a namespace. */ - tag = "Function"; do_returns = 1; + tag = "Function"; do_returns = 1; do_static_function = 1; } } @@ -1956,7 +1968,8 @@ xml_output_function_decl (xml_dump_info_p xdi, tree fd, xml_dump_node_p dn) if(do_explicit) xml_print_explicit_attribute (xdi, fd); if(do_const) xml_print_const_method_attribute (xdi, fd); if(do_virtual) xml_print_virtual_method_attributes (xdi, fd); - if(do_static) xml_print_static_method_attribute (xdi, fd); + if(do_static_method) xml_print_static_method_attribute (xdi, fd); + if(do_static_function) xml_print_static_attribute (xdi, fd); if(do_artificial) xml_print_artificial_attribute (xdi, fd); xml_print_throw_attribute (xdi, TREE_TYPE (fd), dn->complete); xml_print_context_attribute (xdi, fd); @@ -2043,7 +2056,7 @@ xml_document_add_element_function_helper (xml_document_info_p xdi, } if(do_static) { - xml_document_add_attribute_static_method(e); + xml_document_add_attribute_static(e); } if(do_artificial) { @@ -2096,7 +2109,7 @@ xml_document_add_element_function (xml_document_info_p xdi, /*do_explicit*/ 0, /*allow_arguments*/ 1, /*allow_ellipsis*/ 0); xml_document_add_element_function_helper( xdi, parent, "OperatorFunction", /*do_returns*/ 1, /*do_access*/ 0, - /*do_const*/ 0, /*do_virtual*/ 0, /*do_static*/ 0, /*do_artificial*/ 0, + /*do_const*/ 0, /*do_virtual*/ 0, /*do_static*/ 1, /*do_artificial*/ 0, /*do_explicit*/ 0, /*allow_arguments*/ 1, /*allow_ellipsis*/ 0); xml_document_add_element_function_helper( xdi, parent, "Method", /*do_returns*/ 1, /*do_access*/ 1, @@ -2104,7 +2117,7 @@ xml_document_add_element_function (xml_document_info_p xdi, /*do_explicit*/ 0, /*allow_arguments*/ 1, /*allow_ellipsis*/ 1); xml_document_add_element_function_helper( xdi, parent, "Function", /*do_returns*/ 1, /*do_access*/ 0, - /*do_const*/ 0, /*do_virtual*/ 0, /*do_static*/ 0, /*do_artificial*/ 0, + /*do_const*/ 0, /*do_virtual*/ 0, /*do_static*/ 1, /*do_artificial*/ 0, /*do_explicit*/ 0, /*allow_arguments*/ 1, /*allow_ellipsis*/ 1); } @@ -2124,6 +2137,7 @@ xml_output_var_decl (xml_dump_info_p xdi, tree vd, xml_dump_node_p dn) xml_print_mangled_attribute (xdi, vd); xml_print_demangled_attribute (xdi, vd ); xml_print_location_attribute (xdi, vd); + xml_print_static_attribute(xdi, vd); xml_print_extern_attribute (xdi, vd); xml_print_artificial_attribute (xdi, vd); xml_print_attributes_attribute (xdi, DECL_ATTRIBUTES(vd), 0); @@ -2145,6 +2159,7 @@ xml_document_add_element_var_decl (xml_document_info_p xdi, xml_document_add_attribute_mangled(e); xml_document_add_attribute_demangled(e); xml_document_add_attribute_location(e, xml_document_attribute_use_required); + xml_document_add_attribute_static(e); xml_document_add_attribute_extern(e); xml_document_add_attribute_artificial(e); xml_document_add_attribute_attributes(e); diff --git a/GCC_XML/CMakeLists.txt b/GCC_XML/CMakeLists.txt index 834a289..ca6ebd8 100644 --- a/GCC_XML/CMakeLists.txt +++ b/GCC_XML/CMakeLists.txt @@ -1,9 +1,6 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) PROJECT(GCCXML) -# We now need at least CMake 2.4.5 to get some custom command fixes -# and a working INSTALL(DIRECTORY). -CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR) - # Set the version number. SET(GCCXML_VERSION_MAJOR 0) SET(GCCXML_VERSION_MINOR 9) @@ -99,6 +96,16 @@ IF("${CMAKE_SYSTEM}" MATCHES "AIX") SET(KWSYS_LFS_DISABLE 1) ENDIF("${CMAKE_SYSTEM}" MATCHES "AIX") INCLUDE_DIRECTORIES(${GCCXML_BINARY_DIR}) +# install gxsys if requested: +IF(GCCXML_INSTALL_FOR_MUMMY) + IF(NOT KWSYS_INSTALL_INCLUDE_DIR) + SET(KWSYS_INSTALL_INCLUDE_DIR include) + ENDIF(NOT KWSYS_INSTALL_INCLUDE_DIR) + IF(NOT KWSYS_INSTALL_LIB_DIR) + SET(KWSYS_INSTALL_LIB_DIR lib) + ENDIF(NOT KWSYS_INSTALL_LIB_DIR) + SET(KWSYS_USE_CommandLineArguments 1) +ENDIF(GCCXML_INSTALL_FOR_MUMMY) SUBDIRS(KWSys) # Installation directories. diff --git a/GCC_XML/GXFront/gxConfiguration.cxx b/GCC_XML/GXFront/gxConfiguration.cxx index 8479369..87e1c68 100644 --- a/GCC_XML/GXFront/gxConfiguration.cxx +++ b/GCC_XML/GXFront/gxConfiguration.cxx @@ -55,6 +55,11 @@ const char* gxConfigurationVc9exRegistry = const char* gxConfigurationVc9sdkRegistry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0A;InstallationFolder"; +const char* gxConfigurationVc10Registry = +"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir"; +const char* gxConfigurationVc10sdkRegistry = +"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.0A;InstallationFolder"; + //---------------------------------------------------------------------------- gxConfiguration::gxConfiguration() { @@ -127,7 +132,7 @@ bool gxConfiguration::Configure(int argc, const char*const * argv) } #endif loc += "/gccxml_cc1plus"; -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) loc += ".exe"; #endif if(gxSystemTools::FileExists(loc.c_str()) && @@ -155,7 +160,7 @@ bool gxConfiguration::Configure(int argc, const char*const * argv) std::string loc = gxSystemTools::GetFilenamePath(m_GCCXML_EXECUTABLE.c_str()); loc += "/gccxml_cpp0"; -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) loc += ".exe"; #endif if(gxSystemTools::FileExists(loc.c_str()) && @@ -379,7 +384,7 @@ void gxConfiguration::FindRoots(const char* argv0) { exeName = av0.substr(pos+1).c_str(); } -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) exeName = gxSystemTools::LowerCase(exeName.c_str()); if(exeName.length() < 4 || exeName.substr(exeName.length()-4) != ".exe") { @@ -1100,9 +1105,13 @@ bool gxConfiguration::FindFlags() return this->FindFlagsMSVC9(); } } + else if(compilerName == "msvc10") + { + return this->FindFlagsMSVC10(); + } else if(compilerName == "cl") { - // We must decide if this is MSVC 6, 7, 7.1, or 8. + // We must decide if this is MSVC 6, 7, 7.1, 8, 9, or 10. std::string loc; bool have6 = gxSystemTools::ReadRegistryValue(gxConfigurationVc6Registry, loc); @@ -1116,6 +1125,8 @@ bool gxConfiguration::FindFlags() (gxSystemTools::ReadRegistryValue(gxConfigurationVc9Registry, loc) || gxSystemTools::ReadRegistryValue(gxConfigurationVc9exRegistry, loc)); + bool have10 = gxSystemTools::ReadRegistryValue(gxConfigurationVc10Registry, loc); + // Look for a VS8 that is not the beta release. bool have8 = false; if(gxSystemTools::ReadRegistryValue(gxConfigurationVc8Registry, loc)) @@ -1136,31 +1147,35 @@ bool gxConfiguration::FindFlags() } // See if only one is installed. - if(have6 && !have7 && !have71 && !have8 && !have8ex && !have9) + if(have6 && !have7 && !have71 && !have8 && !have8ex && !have9 && !have10) { return this->FindFlagsMSVC6(); } - else if(!have6 && have7 && !have71 && !have8 && !have8ex && !have9) + else if(!have6 && have7 && !have71 && !have8 && !have8ex && !have9 && !have10) { return this->FindFlagsMSVC7(); } - else if(!have6 && !have7 && have71 && !have8 && !have8ex && !have9) + else if(!have6 && !have7 && have71 && !have8 && !have8ex && !have9 && !have10) { return this->FindFlagsMSVC71(); } - else if(!have6 && !have7 && !have71 && have8 && !have8ex && !have9) + else if(!have6 && !have7 && !have71 && have8 && !have8ex && !have9 && !have10) { return this->FindFlagsMSVC8(); } - else if(!have6 && !have7 && !have71 && !have8 && have8ex && !have9) + else if(!have6 && !have7 && !have71 && !have8 && have8ex && !have9 && !have10) { return this->FindFlagsMSVC8ex(); } - else if(!have6 && !have7 && !have71 && !have8 && !have8ex && have9) + else if(!have6 && !have7 && !have71 && !have8 && !have8ex && have9 && !have10) { return this->FindFlagsMSVC9(); } - else if(have6 || have7 || have71 || have8 || have8ex || have9) + else if(!have6 && !have7 && !have71 && !have8 && !have8ex && !have9 && have10) + { + return this->FindFlagsMSVC10(); + } + else if(have6 || have7 || have71 || have8 || have8ex || have9 || have10) { // Find available support directories. bool support6 = have6 && this->FindData("Vc6"); @@ -1169,45 +1184,51 @@ bool gxConfiguration::FindFlags() bool support8 = have8 && this->FindData("Vc8"); bool support8ex = have8ex && this->FindData("Vc8ex"); bool support9 = have9 && this->FindData("Vc9"); + bool support10 = have10 && this->FindData("Vc10"); // Have more than one. See if only one has the support // directory available. if(support6 && !support7 && !support71 && !support8 && - !support8ex && !support9) + !support8ex && !support9 && !support10) { return this->FindFlagsMSVC6(); } else if(!support6 && support7 && !support71 && !support8 && - !support8ex && !support9) + !support8ex && !support9 && !support10) { return this->FindFlagsMSVC7(); } else if(!support6 && !support7 && support71 && !support8 && - !support8ex && !support9) + !support8ex && !support9 && !support10) { return this->FindFlagsMSVC71(); } else if(!support6 && !support7 && !support71 && support8 && - !support8ex && !support9) + !support8ex && !support9 && !support10) { return this->FindFlagsMSVC8(); } else if(!support6 && !support7 && !support71 && !support8 && - support8ex && !support9) + support8ex && !support9 && !support10) { return this->FindFlagsMSVC8ex(); } else if(!support6 && !support7 && !support71 && !support8 && - !support8ex && support9) + !support8ex && support9 && !support10) { return this->FindFlagsMSVC9(); } else if(!support6 && !support7 && !support71 && !support8 && - !support8ex && !support9) + !support8ex && !support9 && support10) + { + return this->FindFlagsMSVC10(); + } + else if(!support6 && !support7 && !support71 && !support8 && + !support8ex && !support9 && !support10) { std::cerr << "Compiler \"" << m_GCCXML_COMPILER << "\" is not supported by GCC_XML because none of \n" - << "the Vc6, Vc7, Vc71, Vc8, or Vc8ex " + << "the Vc6, Vc7, Vc71, Vc8, Vc8ex, Vc9, Vc9ex or Vc10 " << "support directories exists.\n"; return false; } @@ -1272,6 +1293,10 @@ bool gxConfiguration::FindFlags() { return this->FindFlagsMSVC9(); } + else if(output.find("Compiler Version 16.") != std::string::npos) + { + return this->FindFlagsMSVC10(); + } } // Couldn't tell by running the compiler. } @@ -1279,9 +1304,9 @@ bool gxConfiguration::FindFlags() // was used to build this executable. const char* const clText = "Compiler \"cl\" specified, but more than one of " - "MSVC 6, 7, 7.1, 8, and 9 are installed.\n" + "MSVC 6, 7, 7.1, 8, 9, and 10 are installed.\n" "Please specify \"msvc6\", \"msvc7\", \"msvc71\", \"msvc8\", " - "\"msvc8ex\", or \"msvc9\" for " + "\"msvc8ex\", \"msvc9\", or \"msvc10\" for " "the GCCXML_COMPILER setting.\n"; #if defined(_MSC_VER) && ((_MSC_VER >= 1200) && (_MSC_VER < 1300)) std::cerr << "Warning:\n" << clText @@ -1319,6 +1344,11 @@ bool gxConfiguration::FindFlags() << "Using MSVC 9 because it was used to build GCC-XML.\n" << "\n"; return this->FindFlagsMSVC9(); +#elif defined(_MSC_VER) && ((_MSC_VER >= 1600) && (_MSC_VER < 1700)) + std::cerr << "Warning:\n" << clText + << "Using MSVC 10 because it was used to build GCC-XML.\n" + << "\n"; + return this->FindFlagsMSVC10(); #else // Give up. The user must specify one. std::cerr << clText; @@ -1329,7 +1359,7 @@ bool gxConfiguration::FindFlags() { std::cerr << "Compiler \"" << m_GCCXML_COMPILER << "\" is not supported by GCC_XML because " - << "none of MSVC 6, 7, 7.1, 8, or 9 is installed.\n"; + << "none of MSVC 6, 7, 7.1, 8, 9 or 10 is installed.\n"; return false; } } @@ -2448,6 +2478,77 @@ bool gxConfiguration::FindFlagsMSVC9() return true; } +//---------------------------------------------------------------------------- +bool gxConfiguration::FindFlagsMSVC10() +{ + // The registry key to use when attempting to automatically find the + // MSVC include files. + std::string msvcPath; + if(!gxSystemTools::ReadRegistryValue(gxConfigurationVc10Registry, msvcPath)) + { + std::cerr << "Error finding MSVC 10 from registry.\n"; + return false; + } + std::string psdkPath; + if(!gxSystemTools::ReadRegistryValue(gxConfigurationVc10sdkRegistry, psdkPath)) + { + std::cerr << "Error finding MSVC 10 Platform SDK from registry.\n"; + return false; + } + std::string msvcPath1 = msvcPath+"/Include"; + std::string msvcPath2 = psdkPath+"/Include"; + msvcPath1 = gxSystemTools::CollapseDirectory(msvcPath1.c_str()); + msvcPath2 = gxSystemTools::CollapseDirectory(msvcPath2.c_str()); + std::string vcIncludePath1; + std::string vcIncludePath2; + if(!this->FindData("Vc10/Include", vcIncludePath1) || + !this->FindData("Vc10/PlatformSDK", vcIncludePath2)) + { + return false; + } + + m_GCCXML_FLAGS = + "-U__STDC__ -U__STDC_HOSTED__ " + "-D__stdcall=__attribute__((__stdcall__)) " + "-D__cdecl=__attribute__((__cdecl__)) " + "-D__fastcall=__attribute__((__fastcall__)) " + "-D__thiscall=__attribute__((__thiscall__)) " + "-D_stdcall=__attribute__((__stdcall__)) " + "-D_cdecl=__attribute__((__cdecl__)) " + "-D_fastcall=__attribute__((__fastcall__)) " + "-D_thiscall=__attribute__((__thiscall__)) " + "-D__declspec(x)=__attribute__((x)) -D__pragma(x)= " + "-D__cplusplus -D_inline=inline -D__forceinline=__inline " + "-D_MSC_VER=1600 -D_MSC_EXTENSIONS -D_WIN32 " + "-D_M_IX86 " + "-D_WCHAR_T_DEFINED -DPASCAL= -DRPC_ENTRY= -DSHSTDAPI=HRESULT " + "-D_INTEGRAL_MAX_BITS=64 " + "-D_HAS_CPP0X=0 " + "-D__uuidof(x)=IID() -DSHSTDAPI_(x)=x " + "-D__w64= " + "-D__int8=char " + "-D__int16=short " + "-D__int32=int " + "-D__int64=\"long long\" " + "-D__ptr64= " + "-DSTRSAFE_NO_DEPRECATE " + "-D_CRT_FAR_MAPPINGS_NO_DEPRECATE " + "-D_CRT_MANAGED_FP_NO_DEPRECATE " + "-D_CRT_MANAGED_HEAP_NO_DEPRECATE " + "-D_CRT_NONSTDC_NO_DEPRECATE " + "-D_CRT_OBSOLETE_NO_DEPRECATE " + "-D_CRT_SECURE_NO_DEPRECATE " + "-D_CRT_SECURE_NO_DEPRECATE_GLOBALS " + "-D_CRT_VCCLRIT_NO_DEPRECATE " + "-D_SCL_SECURE_NO_DEPRECATE " + "-D_WINDOWS_SECURE_NO_DEPRECATE " + "-iwrapper\""+vcIncludePath1+"\" " + "-iwrapper\""+vcIncludePath2+"\" " + "-I\""+msvcPath1+"\" " + "-I\""+msvcPath2+"\" "; + return true; +} + //---------------------------------------------------------------------------- bool gxConfiguration::FindFlagsBCC55(const char* inBcc32) { diff --git a/GCC_XML/GXFront/gxConfiguration.h b/GCC_XML/GXFront/gxConfiguration.h index 8fcfe33..dee38f8 100644 --- a/GCC_XML/GXFront/gxConfiguration.h +++ b/GCC_XML/GXFront/gxConfiguration.h @@ -163,6 +163,7 @@ class gxConfiguration bool FindFlagsMSVC8(); bool FindFlagsMSVC8ex(); bool FindFlagsMSVC9(); + bool FindFlagsMSVC10(); bool FindFlagsBCC55(const char* inBcc32); }; diff --git a/GCC_XML/KWSys/CMakeLists.txt b/GCC_XML/KWSys/CMakeLists.txt index bcc7a96..0ef4e28 100644 --- a/GCC_XML/KWSys/CMakeLists.txt +++ b/GCC_XML/KWSys/CMakeLists.txt @@ -1,6 +1,6 @@ #============================================================================= # KWSys - Kitware System Library -# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -44,9 +44,7 @@ # SET(KWSYS_IOS_FORCE_OLD 1) # # -# Optional settings to setup install rules work in one of two ways. -# The modern way utilizes the CMake 2.4 INSTALL command. Settings -# for this mode are as follows: +# Optional settings to setup install rules are as follows: # # KWSYS_INSTALL_BIN_DIR = The installation target directories into # KWSYS_INSTALL_LIB_DIR which the libraries and headers from @@ -61,6 +59,8 @@ # If not given the install rules # will not be in any component. # +# KWSYS_INSTALL_EXPORT_NAME = The EXPORT option value for install(TARGETS) calls. +# # Example: # # SET(KWSYS_INSTALL_BIN_DIR bin) @@ -68,25 +68,6 @@ # SET(KWSYS_INSTALL_INCLUDE_DIR include) # SET(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME Runtime) # SET(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT Development) -# -# The old way uses the original CMake INSTALL_* commands. Settings -# for this mode are as follows: -# -# KWSYS_LIBRARY_INSTALL_DIR = The installation target directories into -# KWSYS_HEADER_INSTALL_DIR which the libraries and headers from -# kwsys should be installed by a "make install". -# The values should be specified relative to -# the installation prefix and start with a '/'. -# Example: -# -# SET(KWSYS_LIBRARY_INSTALL_DIR /lib) -# SET(KWSYS_HEADER_INSTALL_DIR /include) -# -# The modern way will be used whenever the INSTALL command is -# available. If the settings are not available the old names will be -# used to construct them. The old way will be used whenever the -# INSTALL command is not available. If the settings are not available -# the new names will be used to construct them. # Once configured, kwsys should be used as follows from C or C++ code: # @@ -103,13 +84,7 @@ # any outside mailing list and no documentation of the change will be # written. -CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR) -IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) - -# Allow empty endif() and such with CMake 2.4. -SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) #----------------------------------------------------------------------------- # If a namespace is not specified, use "kwsys" and enable testing. @@ -124,23 +99,11 @@ ENDIF(NOT KWSYS_NAMESPACE) # The project name is that of the specified namespace. PROJECT(${KWSYS_NAMESPACE}) -# Some properties we set only with CMake 2.6 and above. -IF(COMMAND SET_PROPERTY) - MACRO(KWSYS_SET_PROPERTY) - SET_PROPERTY(${ARGV}) - ENDMACRO(KWSYS_SET_PROPERTY) -ELSE(COMMAND SET_PROPERTY) - MACRO(KWSYS_SET_PROPERTY) - ENDMACRO(KWSYS_SET_PROPERTY) -ENDIF(COMMAND SET_PROPERTY) - # Tell CMake how to follow dependencies of sources in this directory. -IF(COMMAND SET_PROPERTY) - SET_PROPERTY(DIRECTORY - PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM - "KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>" - ) -ENDIF(COMMAND SET_PROPERTY) +SET_PROPERTY(DIRECTORY + PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM + "KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>" + ) # Select library components. IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) @@ -206,94 +169,75 @@ INCLUDE(CheckTypeSize) # Do full dependency headers. INCLUDE_REGULAR_EXPRESSION("^.*$") -# Choose which kind of install commands to use. -IF(COMMAND INSTALL) - # Use new KWSYS_INSTALL_*_DIR variable names to control installation. - # Take defaults from the old names. Note that there was no old name - # for the bin dir, so we take the old lib dir name so DLLs will be - # installed in a compatible way for old code. - IF(NOT KWSYS_INSTALL_INCLUDE_DIR) - STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_INCLUDE_DIR - "${KWSYS_HEADER_INSTALL_DIR}") - ENDIF(NOT KWSYS_INSTALL_INCLUDE_DIR) - IF(NOT KWSYS_INSTALL_LIB_DIR) - STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_LIB_DIR - "${KWSYS_LIBRARY_INSTALL_DIR}") - ENDIF(NOT KWSYS_INSTALL_LIB_DIR) - IF(NOT KWSYS_INSTALL_BIN_DIR) - STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_BIN_DIR - "${KWSYS_LIBRARY_INSTALL_DIR}") - ENDIF(NOT KWSYS_INSTALL_BIN_DIR) - - # Setup header install rules. - SET(KWSYS_INSTALL_INCLUDE_OPTIONS) - IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) - SET(KWSYS_INSTALL_INCLUDE_OPTIONS ${KWSYS_INSTALL_INCLUDE_OPTIONS} - COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} - ) - ENDIF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) +# Use new KWSYS_INSTALL_*_DIR variable names to control installation. +# Take defaults from the old names. Note that there was no old name +# for the bin dir, so we take the old lib dir name so DLLs will be +# installed in a compatible way for old code. +IF(NOT KWSYS_INSTALL_INCLUDE_DIR) + STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_INCLUDE_DIR + "${KWSYS_HEADER_INSTALL_DIR}") +ENDIF(NOT KWSYS_INSTALL_INCLUDE_DIR) +IF(NOT KWSYS_INSTALL_LIB_DIR) + STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_LIB_DIR + "${KWSYS_LIBRARY_INSTALL_DIR}") +ENDIF(NOT KWSYS_INSTALL_LIB_DIR) +IF(NOT KWSYS_INSTALL_BIN_DIR) + STRING(REGEX REPLACE "^/" "" KWSYS_INSTALL_BIN_DIR + "${KWSYS_LIBRARY_INSTALL_DIR}") +ENDIF(NOT KWSYS_INSTALL_BIN_DIR) + +# Setup header install rules. +SET(KWSYS_INSTALL_INCLUDE_OPTIONS) +IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) + SET(KWSYS_INSTALL_INCLUDE_OPTIONS ${KWSYS_INSTALL_INCLUDE_OPTIONS} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} + ) +ENDIF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) - # Setup library install rules. - SET(KWSYS_INSTALL_LIBRARY_RULE) - IF(KWSYS_INSTALL_LIB_DIR) - # Install the shared library to the lib directory. +# Setup library install rules. +SET(KWSYS_INSTALL_LIBRARY_RULE) +IF(KWSYS_INSTALL_LIB_DIR) + IF(KWSYS_INSTALL_EXPORT_NAME) + LIST(APPEND KWSYS_INSTALL_LIBRARY_RULE EXPORT ${KWSYS_INSTALL_EXPORT_NAME}) + ENDIF() + # Install the shared library to the lib directory. + SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} + LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR} + ) + # Assign the shared library to the runtime component. + IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - LIBRARY DESTINATION ${KWSYS_INSTALL_LIB_DIR} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} ) - # Assign the shared library to the runtime component. - IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) - SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} - ) - ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) + ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) - # Install the archive to the lib directory. + # Install the archive to the lib directory. + SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} + ARCHIVE DESTINATION ${KWSYS_INSTALL_LIB_DIR} + ) + # Assign the archive to the development component. + IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - ARCHIVE DESTINATION ${KWSYS_INSTALL_LIB_DIR} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} ) - # Assign the archive to the development component. - IF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) - SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT} - ) - ENDIF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) - ENDIF(KWSYS_INSTALL_LIB_DIR) - IF(KWSYS_INSTALL_BIN_DIR) - # Install the runtime library to the bin directory. + ENDIF(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT) +ENDIF(KWSYS_INSTALL_LIB_DIR) +IF(KWSYS_INSTALL_BIN_DIR) + # Install the runtime library to the bin directory. + SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} + RUNTIME DESTINATION ${KWSYS_INSTALL_BIN_DIR} + ) + # Assign the runtime library to the runtime component. + IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - RUNTIME DESTINATION ${KWSYS_INSTALL_BIN_DIR} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} ) - # Assign the runtime library to the runtime component. - IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) - SET(KWSYS_INSTALL_LIBRARY_RULE ${KWSYS_INSTALL_LIBRARY_RULE} - COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} - ) - ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) - ENDIF(KWSYS_INSTALL_BIN_DIR) - - # Do not support old KWSYS_*_INSTALL_DIR variable names. - SET(KWSYS_HEADER_INSTALL_DIR) - SET(KWSYS_LIBRARY_INSTALL_DIR) - -ELSE(COMMAND INSTALL) - # Use old KWSYS_*_INSTALL_DIR variable names. - # Take defaults from the new names. - IF(KWSYS_INSTALL_LIB_DIR) - IF(NOT KWSYS_LIBRARY_INSTALL_DIR) - SET(KWSYS_LIBRARY_INSTALL_DIR "/${KWSYS_INSTALL_LIB_DIR}") - ENDIF(NOT KWSYS_LIBRARY_INSTALL_DIR) - ENDIF(KWSYS_INSTALL_LIB_DIR) - IF(KWSYS_INSTALL_INCLUDE_DIR) - IF(NOT KWSYS_HEADER_INSTALL_DIR) - SET(KWSYS_HEADER_INSTALL_DIR "/${KWSYS_INSTALL_INCLUDE_DIR}") - ENDIF(NOT KWSYS_HEADER_INSTALL_DIR) - ENDIF(KWSYS_INSTALL_INCLUDE_DIR) + ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) +ENDIF(KWSYS_INSTALL_BIN_DIR) - # Do not support new KWSYS_INSTALL_*_DIR variable names. - SET(KWSYS_INSTALL_BIN_DIR) - SET(KWSYS_INSTALL_INCLUDE_DIR) - SET(KWSYS_INSTALL_LIB_DIR) -ENDIF(COMMAND INSTALL) +# Do not support old KWSYS_*a_INSTALL_DIR variable names. +SET(KWSYS_HEADER_INSTALL_DIR) +SET(KWSYS_LIBRARY_INSTALL_DIR) # Generated source files will need this header. STRING(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" @@ -675,10 +619,6 @@ FOREACH(header DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE}/stl - FILES ${KWSYS_HEADER_DIR}/stl/${header}.hxx) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ELSE(KWSYS_STL_HEADER_EXTRA_${header}) SET(KWSYS_STL_HEADER_EXTRA "") ENDIF(KWSYS_STL_HEADER_EXTRA_${header}) @@ -692,10 +632,6 @@ FOREACH(header DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE}/stl - FILES ${KWSYS_HEADER_DIR}/stl/${header}) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(header) # Provide cstddef header. @@ -706,10 +642,6 @@ IF(KWSYS_INSTALL_INCLUDE_DIR) INSTALL(FILES ${KWSYS_HEADER_DIR}/cstddef DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE} ${KWSYS_INSTALL_INCLUDE_OPTIONS}) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE} - FILES ${KWSYS_HEADER_DIR}/cstddef) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) #----------------------------------------------------------------------------- @@ -727,10 +659,6 @@ FOREACH(header iostream fstream sstream iosfwd) DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/ios ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE}/ios - FILES ${KWSYS_HEADER_DIR}/ios/${header}) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(header) #----------------------------------------------------------------------------- @@ -819,10 +747,6 @@ FOREACH(c ${KWSYS_CLASSES}) DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE} ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE} - FILES ${KWSYS_HEADER_DIR}/${c}.hxx) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(c) # Configure C headers. @@ -838,10 +762,6 @@ FOREACH(h ${KWSYS_H_FILES}) DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE} ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE} - FILES ${KWSYS_HEADER_DIR}/${h}.h) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(h) # Configure other C++ headers. @@ -857,10 +777,6 @@ FOREACH(h ${KWSYS_HXX_FILES}) DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE} ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF(KWSYS_INSTALL_INCLUDE_DIR) - IF(KWSYS_HEADER_INSTALL_DIR) - INSTALL_FILES(${KWSYS_HEADER_INSTALL_DIR}/${KWSYS_NAMESPACE} - FILES ${KWSYS_HEADER_DIR}/${h}.hxx) - ENDIF(KWSYS_HEADER_INSTALL_DIR) ENDFOREACH(h) #----------------------------------------------------------------------------- @@ -868,7 +784,7 @@ ENDFOREACH(h) IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) ADD_LIBRARY(${KWSYS_NAMESPACE} ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY LABELS ${KWSYS_LABELS_LIB}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE} PROPERTY LABELS ${KWSYS_LABELS_LIB}) IF(KWSYS_USE_DynamicLoader) IF(UNIX) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} ${CMAKE_DL_LIBS}) @@ -890,15 +806,12 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) IF(KWSYS_INSTALL_LIBRARY_RULE) INSTALL(TARGETS ${KWSYS_NAMESPACE} ${KWSYS_INSTALL_LIBRARY_RULE}) ENDIF(KWSYS_INSTALL_LIBRARY_RULE) - IF(KWSYS_LIBRARY_INSTALL_DIR) - INSTALL_TARGETS(${KWSYS_LIBRARY_INSTALL_DIR} ${KWSYS_NAMESPACE}) - ENDIF(KWSYS_LIBRARY_INSTALL_DIR) ENDIF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) # Add a C-only library if requested. IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) ADD_LIBRARY(${KWSYS_NAMESPACE}_c ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}_c PROPERTY LABELS ${KWSYS_LABELS_LIB}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}_c PROPERTY LABELS ${KWSYS_LABELS_LIB}) # Apply user-defined target properties to the library. IF(KWSYS_PROPERTIES_C) @@ -911,9 +824,6 @@ IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) IF(KWSYS_INSTALL_LIBRARY_RULE) INSTALL(TARGETS ${KWSYS_NAMESPACE}_c ${KWSYS_INSTALL_LIBRARY_RULE}) ENDIF(KWSYS_INSTALL_LIBRARY_RULE) - IF(KWSYS_LIBRARY_INSTALL_DIR) - INSTALL_TARGETS(${KWSYS_LIBRARY_INSTALL_DIR} ${KWSYS_NAMESPACE}_c) - ENDIF(KWSYS_LIBRARY_INSTALL_DIR) ENDIF(KWSYS_ENABLE_C AND KWSYS_C_SRCS) # For building kwsys itself, we use a macro defined on the command @@ -937,14 +847,10 @@ IF(KWSYS_USE_Process) # encode it into a C file. ADD_EXECUTABLE(${KWSYS_NAMESPACE}ProcessFwd9x ProcessFwd9x.c) ADD_EXECUTABLE(${KWSYS_NAMESPACE}EncodeExecutable EncodeExecutable.c) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}ProcessFwd9x PROPERTY LABELS ${KWSYS_LABELS_EXE}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}EncodeExecutable PROPERTY LABELS ${KWSYS_LABELS_EXE}) - - # Construct the location of the executable to be encoded. - SET(BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) - IF(EXECUTABLE_OUTPUT_PATH) - SET(BIN_DIR ${EXECUTABLE_OUTPUT_PATH}) - ENDIF(EXECUTABLE_OUTPUT_PATH) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}ProcessFwd9x PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}EncodeExecutable PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}ProcessFwd9x PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}EncodeExecutable PROPERTY LABELS ${KWSYS_LABELS_EXE}) SET(CFG_INTDIR "/${CMAKE_CFG_INTDIR}") IF(CMAKE_BUILD_TOOL MATCHES "make") @@ -952,25 +858,14 @@ IF(KWSYS_USE_Process) ENDIF(CMAKE_BUILD_TOOL MATCHES "make") # Take advantage of a better custom command syntax if possible. - SET(CMD ${BIN_DIR}${CFG_INTDIR}/${KWSYS_NAMESPACE}EncodeExecutable.exe) - SET(FWD ${BIN_DIR}${CFG_INTDIR}/${KWSYS_NAMESPACE}ProcessFwd9x.exe) - IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.6) - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c - COMMAND ${CMD} - ARGS ${FWD} ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c - ${KWSYS_NAMESPACE} ProcessFwd9x - DEPENDS ${CMD} ${FWD}) - ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.6) - ADD_CUSTOM_COMMAND( - TARGET ${KWSYS_NAMESPACE} - SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/ProcessFwd9x.c - COMMAND ${CMD} - ARGS ${FWD} ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c - ${KWSYS_NAMESPACE} ProcessFwd9x - OUTPUTS ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c - DEPENDS ${CMD} ${FWD}) - ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.6) + SET(CMD ${CMAKE_CURRENT_BINARY_DIR}${CFG_INTDIR}/${KWSYS_NAMESPACE}EncodeExecutable.exe) + SET(FWD ${CMAKE_CURRENT_BINARY_DIR}${CFG_INTDIR}/${KWSYS_NAMESPACE}ProcessFwd9x.exe) + ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c + COMMAND ${CMD} + ARGS ${FWD} ${CMAKE_CURRENT_BINARY_DIR}/${KWSYS_NAMESPACE}ProcessFwd9xEnc.c + ${KWSYS_NAMESPACE} ProcessFwd9x + DEPENDS ${CMD} ${FWD}) # Make sure build occurs in proper order. ADD_DEPENDENCIES(${KWSYS_NAMESPACE} ${KWSYS_NAMESPACE}ProcessFwd9x @@ -993,19 +888,19 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) testEncode testTerminal ) - IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + IF(KWSYS_STANDALONE) SET(KWSYS_C_TESTS ${KWSYS_C_TESTS} testFail) - ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + ENDIF() CREATE_TEST_SOURCELIST( KWSYS_C_TEST_SRCS ${KWSYS_NAMESPACE}TestsC.c ${KWSYS_C_TESTS} ) ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestsC ${KWSYS_C_TEST_SRCS}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsC PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsC PROPERTY LABELS ${KWSYS_LABELS_EXE}) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsC ${KWSYS_NAMESPACE}_c) FOREACH(test ${KWSYS_C_TESTS}) ADD_TEST(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsC ${test} ${KWSYS_TEST_ARGS_${test}}) - KWSYS_SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) ENDFOREACH(test) # C++ tests @@ -1029,7 +924,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS} testDynamicLoader) # If kwsys contains the DynamicLoader, need extra library ADD_LIBRARY(${KWSYS_NAMESPACE}TestDynload MODULE testDynload.c) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestDynload PROPERTY LABELS ${KWSYS_LABELS_LIB}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestDynload PROPERTY LABELS ${KWSYS_LABELS_LIB}) ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestDynload ${KWSYS_NAMESPACE}) ENDIF(KWSYS_USE_DynamicLoader) CREATE_TEST_SOURCELIST( @@ -1037,7 +932,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ${KWSYS_CXX_TESTS} ) ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_CXX_TEST_SRCS}) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestsCxx PROPERTY LABELS ${KWSYS_LABELS_EXE}) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestsCxx ${KWSYS_NAMESPACE}) SET(TEST_SYSTEMTOOLS_BIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/testSystemTools.bin") @@ -1084,19 +979,19 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ) FOREACH(test ${KWSYS_CXX_TESTS}) ADD_TEST(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsCxx ${test} ${KWSYS_TEST_ARGS_${test}}) - KWSYS_SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_PROPERTY(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) ENDFOREACH(test) # Process tests. ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestProcess testProcess.c) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestProcess PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestProcess PROPERTY LABELS ${KWSYS_LABELS_EXE}) TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE}TestProcess ${KWSYS_NAMESPACE}_c) IF(NOT CYGWIN) SET(KWSYS_TEST_PROCESS_7 7) ENDIF(NOT CYGWIN) FOREACH(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7}) ADD_TEST(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n}) - KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120) ENDFOREACH(n) @@ -1110,13 +1005,13 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) ${PROJECT_BINARY_DIR}/testSharedForward.c @ONLY IMMEDIATE) ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestSharedForward ${PROJECT_BINARY_DIR}/testSharedForward.c) - KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestSharedForward PROPERTY LABELS ${KWSYS_LABELS_EXE}) + SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestSharedForward PROPERTY LABELS ${KWSYS_LABELS_EXE}) ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestSharedForward ${KWSYS_NAMESPACE}_c) ADD_TEST(kwsys.testSharedForward ${EXEC_DIR}/${KWSYS_NAMESPACE}TestSharedForward 1) - KWSYS_SET_PROPERTY(TEST kwsys.testSharedForward PROPERTY LABELS ${KWSYS_LABELS_TEST}) + SET_PROPERTY(TEST kwsys.testSharedForward PROPERTY LABELS ${KWSYS_LABELS_TEST}) # Configure some test properties. - IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + IF(KWSYS_STANDALONE) # We expect test to fail SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES WILL_FAIL ON) GET_TEST_PROPERTY(kwsys.testFail WILL_FAIL wfv) @@ -1124,7 +1019,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET_TESTS_PROPERTIES(kwsys.testRegistry PROPERTIES PASS_REGULAR_EXPRESSION "Test passed") SET_TESTS_PROPERTIES(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value") MESSAGE(STATUS "GET_TEST_PROPERTY returned: ${wfv}") - ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY AND KWSYS_STANDALONE) + ENDIF() # Suppress known consistent failures on buggy systems. IF(KWSYS_TEST_BOGUS_FAILURES) diff --git a/GCC_XML/KWSys/CheckCXXSourceRuns.cmake b/GCC_XML/KWSys/CheckCXXSourceRuns.cmake deleted file mode 100644 index 7bcc873..0000000 --- a/GCC_XML/KWSys/CheckCXXSourceRuns.cmake +++ /dev/null @@ -1,62 +0,0 @@ -# - Check if the source code provided in the SOURCE argument compiles. -# CHECK_CXX_SOURCE_COMPILES(SOURCE VAR) -# - macro which checks if the source code compiles\ -# SOURCE - source code to try to compile -# VAR - variable to store size if the type exists. -# -# The following variables may be set before calling this macro to -# modify the way the check is run: -# -# CMAKE_REQUIRED_FLAGS = string of compile command line flags -# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) -# CMAKE_REQUIRED_INCLUDES = list of include directories -# CMAKE_REQUIRED_LIBRARIES = list of libraries to link - -MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR COMMENT) - IF("HAVE_${VAR}" MATCHES "^HAVE_${VAR}$") - SET(MACRO_CHECK_FUNCTION_DEFINITIONS - "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") - IF(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES - "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - ELSE(CMAKE_REQUIRED_LIBRARIES) - SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) - ENDIF(CMAKE_REQUIRED_LIBRARIES) - IF(CMAKE_REQUIRED_INCLUDES) - SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES - "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - ELSE(CMAKE_REQUIRED_INCLUDES) - SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES) - ENDIF(CMAKE_REQUIRED_INCLUDES) - SET(CMAKE_EMPTY_INPUT_FILE_CONTENT "${SOURCE}") - CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CMakeEmptyInputFile.in" - "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx" IMMEDIATE) - - MESSAGE(STATUS "Performing Test ${COMMENT}") - TRY_RUN(${VAR} HAVE_${VAR} - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - "${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}" - "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}" - OUTPUT_VARIABLE OUTPUT) - IF(HAVE_${VAR}) - SET(${VAR} 1 CACHE INTERNAL "Test ${COMMENT}") - MESSAGE(STATUS "Performing Test ${COMMENT} - Success") - FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log - "Performing C++ SOURCE FILE Test ${COMMENT} succeded with the following output:\n" - "${OUTPUT}\n" - "Source file was:\n${SOURCE}\n") - ELSE(HAVE_${VAR}) - MESSAGE(STATUS "Performing Test ${COMMENT} - Failed") - SET(${VAR} "" CACHE INTERNAL "Test ${COMMENT}") - FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Performing C++ SOURCE FILE Test ${COMMENT} failed with the following output:\n" - "${OUTPUT}\n" - "Source file was:\n${SOURCE}\n") - ENDIF(HAVE_${VAR}) - ENDIF("HAVE_${VAR}" MATCHES "^HAVE_${VAR}$") -ENDMACRO(CHECK_CXX_SOURCE_RUNS) - - diff --git a/GCC_XML/KWSys/EncodeExecutable.c b/GCC_XML/KWSys/EncodeExecutable.c index ba474b8..bc30568 100644 --- a/GCC_XML/KWSys/EncodeExecutable.c +++ b/GCC_XML/KWSys/EncodeExecutable.c @@ -41,6 +41,7 @@ int main(int argc, char* argv[]) if(!ofp) { fprintf(stderr, "Cannot open output file: \"%s\"\n", argv[2]); + fclose(ifp); return 2; } diff --git a/GCC_XML/KWSys/Glob.cxx b/GCC_XML/KWSys/Glob.cxx index c1f5100..513eb64 100644 --- a/GCC_XML/KWSys/Glob.cxx +++ b/GCC_XML/KWSys/Glob.cxx @@ -215,7 +215,7 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern, //---------------------------------------------------------------------------- void Glob::RecurseDirectory(kwsys_stl::string::size_type start, - const kwsys_stl::string& dir, bool dir_only) + const kwsys_stl::string& dir) { kwsys::Directory d; if ( !d.Load(dir.c_str()) ) @@ -258,25 +258,24 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, fullname = dir + "/" + fname; } - if ( !dir_only || !kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) + bool isDir = kwsys::SystemTools::FileIsDirectory(realname.c_str()); + bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str()); + + if ( isDir && (!isSymLink || this->RecurseThroughSymlinks) ) { - if ( (this->Internals->Expressions.size() > 0) && - this->Internals->Expressions[ - this->Internals->Expressions.size()-1].find(fname.c_str()) ) + if (isSymLink) { - this->AddFile(this->Internals->Files, realname.c_str()); + ++this->FollowedSymlinkCount; } + this->RecurseDirectory(start+1, realname); } - if ( kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) + else { - bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname.c_str()); - if (!isSymLink || this->RecurseThroughSymlinks) + if ( (this->Internals->Expressions.size() > 0) && + this->Internals->Expressions[ + this->Internals->Expressions.size()-1].find(fname.c_str()) ) { - if (isSymLink) - { - ++this->FollowedSymlinkCount; - } - this->RecurseDirectory(start+1, realname, dir_only); + this->AddFile(this->Internals->Files, realname.c_str()); } } } @@ -284,13 +283,13 @@ void Glob::RecurseDirectory(kwsys_stl::string::size_type start, //---------------------------------------------------------------------------- void Glob::ProcessDirectory(kwsys_stl::string::size_type start, - const kwsys_stl::string& dir, bool dir_only) + const kwsys_stl::string& dir) { //kwsys_ios::cout << "ProcessDirectory: " << dir << kwsys_ios::endl; bool last = ( start == this->Internals->Expressions.size()-1 ); if ( last && this->Recurse ) { - this->RecurseDirectory(start, dir, dir_only); + this->RecurseDirectory(start, dir); return; } @@ -345,7 +344,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start, // << this->Internals->TextExpressions[start].c_str() << kwsys_ios::endl; //kwsys_ios::cout << "Full name: " << fullname << kwsys_ios::endl; - if ( (!dir_only || !last) && + if ( !last && !kwsys::SystemTools::FileIsDirectory(realname.c_str()) ) { continue; @@ -359,7 +358,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start, } else { - this->ProcessDirectory(start+1, realname + "/", dir_only); + this->ProcessDirectory(start+1, realname + "/"); } } } @@ -462,12 +461,11 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr) // Handle network paths if ( skip > 0 ) { - this->ProcessDirectory(0, fexpr.substr(0, skip) + "/", - true); + this->ProcessDirectory(0, fexpr.substr(0, skip) + "/"); } else { - this->ProcessDirectory(0, "/", true); + this->ProcessDirectory(0, "/"); } return true; } diff --git a/GCC_XML/KWSys/Glob.hxx.in b/GCC_XML/KWSys/Glob.hxx.in index cb050ee..88c343c 100644 --- a/GCC_XML/KWSys/Glob.hxx.in +++ b/GCC_XML/KWSys/Glob.hxx.in @@ -83,12 +83,12 @@ public: protected: //! Process directory void ProcessDirectory(kwsys_stl::string::size_type start, - const kwsys_stl::string& dir, bool dir_only); + const kwsys_stl::string& dir); //! Process last directory, but only when recurse flags is on. That is // effectively like saying: /path/to/file/**/file void RecurseDirectory(kwsys_stl::string::size_type start, - const kwsys_stl::string& dir, bool dir_only); + const kwsys_stl::string& dir); //! Add regular expression void AddExpression(const char* expr); diff --git a/GCC_XML/KWSys/MD5.c b/GCC_XML/KWSys/MD5.c index 1ea0a66..56776a3 100644 --- a/GCC_XML/KWSys/MD5.c +++ b/GCC_XML/KWSys/MD5.c @@ -29,6 +29,11 @@ it in a single source file instead of a separate header and implementation file. */ +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wcast-align" +#endif + /* Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. @@ -428,6 +433,10 @@ static void md5_finish(md5_state_t *pms, md5_byte_t digest[16]) digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); } +#if defined(__clang__) +# pragma clang diagnostic pop +#endif + /*--------------------------------------------------------------------------*/ /* Wrap up the MD5 state in our opaque structure. */ struct kwsysMD5_s diff --git a/GCC_XML/KWSys/Registry.cxx b/GCC_XML/KWSys/Registry.cxx index 284e8ad..cd521c9 100644 --- a/GCC_XML/KWSys/Registry.cxx +++ b/GCC_XML/KWSys/Registry.cxx @@ -401,8 +401,9 @@ bool RegistryHelper::Open(const char *toplevel, const char *subkey, } else { + char lpClass[] = ""; res = ( RegCreateKeyEx(scope, str.str().c_str(), - 0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, + 0, lpClass, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &this->HKey, &dwDummy) == ERROR_SUCCESS ); } if ( res != 0 ) diff --git a/GCC_XML/KWSys/SystemInformation.cxx b/GCC_XML/KWSys/SystemInformation.cxx index 936c1f7..9bc659e 100644 --- a/GCC_XML/KWSys/SystemInformation.cxx +++ b/GCC_XML/KWSys/SystemInformation.cxx @@ -66,7 +66,6 @@ #endif #ifdef __linux -# include # include # include # include @@ -151,10 +150,6 @@ class SystemInformationImplementation void RunMemoryCheck(); public: -#define VENDOR_STRING_LENGTH (12 + 1) -#define CHIPNAME_STRING_LENGTH (48 + 1) -#define SERIALNUMBER_STRING_LENGTH (29 + 1) - typedef struct tagID { int Type; @@ -163,9 +158,9 @@ class SystemInformationImplementation int Revision; int ExtendedFamily; int ExtendedModel; - char ProcessorName[CHIPNAME_STRING_LENGTH]; - char Vendor[VENDOR_STRING_LENGTH]; - char SerialNumber[SERIALNUMBER_STRING_LENGTH]; + kwsys_stl::string ProcessorName; + kwsys_stl::string Vendor; + kwsys_stl::string SerialNumber; } ID; typedef struct tagCPUPowerManagement @@ -269,6 +264,10 @@ class SystemInformationImplementation //For Haiku OS bool QueryHaikuInfo(); + //For QNX + bool QueryQNXMemory(); + bool QueryQNXProcessor(); + // Evaluate the memory information. int QueryMemory(); size_t TotalVirtualMemory; @@ -530,7 +529,12 @@ SystemInformationImplementation::SystemInformationImplementation() this->CurrentPositionInFile = 0; this->ChipManufacturer = UnknownManufacturer; memset(&this->Features, 0, sizeof(CPUFeatures)); - memset(&this->ChipID, 0, sizeof(ID)); + this->ChipID.Type = 0; + this->ChipID.Family = 0; + this->ChipID.Model = 0; + this->ChipID.Revision = 0; + this->ChipID.ExtendedFamily = 0; + this->ChipID.ExtendedModel = 0; this->CPUSpeedInMHz = 0; this->NumberOfLogicalCPU = 0; this->NumberOfPhysicalCPU = 0; @@ -597,6 +601,8 @@ void SystemInformationImplementation::RunCPUCheck() this->QuerySolarisInfo(); #elif defined(__HAIKU__) this->QueryHaikuInfo(); +#elif defined(__QNX__) + this->QueryQNXProcessor(); #else this->RetreiveInformationFromCpuInfoFile(); #endif @@ -615,6 +621,8 @@ void SystemInformationImplementation::RunMemoryCheck() this->QuerySolarisInfo(); #elif defined(__HAIKU__) this->QueryHaikuInfo(); +#elif defined(__QNX__) + this->QueryQNXMemory(); #else this->QueryMemory(); #endif @@ -623,7 +631,7 @@ void SystemInformationImplementation::RunMemoryCheck() /** Get the vendor string */ const char * SystemInformationImplementation::GetVendorString() { - return this->ChipID.Vendor; + return this->ChipID.Vendor.c_str(); } /** Get the OS Name */ @@ -726,14 +734,14 @@ kwsys_stl::string SystemInformationImplementation::GetSteppingCode() /** Return the stepping code of the CPU present. */ const char * SystemInformationImplementation::GetExtendedProcessorName() { - return this->ChipID.ProcessorName; + return this->ChipID.ProcessorName.c_str(); } /** Return the serial number of the processor * in hexadecimal: xxxx-xxxx-xxxx-xxxx-xxxx-xxxx. */ const char * SystemInformationImplementation::GetProcessorSerialNumber() { - return this->ChipID.SerialNumber; + return this->ChipID.SerialNumber.c_str(); } /** Return the logical processors per physical */ @@ -1022,21 +1030,21 @@ bool SystemInformationImplementation::RetrieveCPUFeatures() /** Find the manufacturer given the vendor id */ void SystemInformationImplementation::FindManufacturer() { - if (strcmp (this->ChipID.Vendor, "GenuineIntel") == 0) this->ChipManufacturer = Intel; // Intel Corp. - else if (strcmp (this->ChipID.Vendor, "UMC UMC UMC ") == 0) this->ChipManufacturer = UMC; // United Microelectronics Corp. - else if (strcmp (this->ChipID.Vendor, "AuthenticAMD") == 0) this->ChipManufacturer = AMD; // Advanced Micro Devices - else if (strcmp (this->ChipID.Vendor, "AMD ISBETTER") == 0) this->ChipManufacturer = AMD; // Advanced Micro Devices (1994) - else if (strcmp (this->ChipID.Vendor, "CyrixInstead") == 0) this->ChipManufacturer = Cyrix; // Cyrix Corp., VIA Inc. - else if (strcmp (this->ChipID.Vendor, "NexGenDriven") == 0) this->ChipManufacturer = NexGen; // NexGen Inc. (now AMD) - else if (strcmp (this->ChipID.Vendor, "CentaurHauls") == 0) this->ChipManufacturer = IDT; // IDT/Centaur (now VIA) - else if (strcmp (this->ChipID.Vendor, "RiseRiseRise") == 0) this->ChipManufacturer = Rise; // Rise - else if (strcmp (this->ChipID.Vendor, "GenuineTMx86") == 0) this->ChipManufacturer = Transmeta; // Transmeta - else if (strcmp (this->ChipID.Vendor, "TransmetaCPU") == 0) this->ChipManufacturer = Transmeta; // Transmeta - else if (strcmp (this->ChipID.Vendor, "Geode By NSC") == 0) this->ChipManufacturer = NSC; // National Semiconductor - else if (strcmp (this->ChipID.Vendor, "Sun") == 0) this->ChipManufacturer = Sun; // Sun Microelectronics - else if (strcmp (this->ChipID.Vendor, "IBM") == 0) this->ChipManufacturer = IBM; // IBM Microelectronics - else if (strcmp (this->ChipID.Vendor, "Motorola") == 0) this->ChipManufacturer = Motorola; // Motorola Microelectronics - else this->ChipManufacturer = UnknownManufacturer; // Unknown manufacturer + if (this->ChipID.Vendor == "GenuineIntel") this->ChipManufacturer = Intel; // Intel Corp. + else if (this->ChipID.Vendor == "UMC UMC UMC ") this->ChipManufacturer = UMC; // United Microelectronics Corp. + else if (this->ChipID.Vendor == "AuthenticAMD") this->ChipManufacturer = AMD; // Advanced Micro Devices + else if (this->ChipID.Vendor == "AMD ISBETTER") this->ChipManufacturer = AMD; // Advanced Micro Devices (1994) + else if (this->ChipID.Vendor == "CyrixInstead") this->ChipManufacturer = Cyrix; // Cyrix Corp., VIA Inc. + else if (this->ChipID.Vendor == "NexGenDriven") this->ChipManufacturer = NexGen; // NexGen Inc. (now AMD) + else if (this->ChipID.Vendor == "CentaurHauls") this->ChipManufacturer = IDT; // IDT/Centaur (now VIA) + else if (this->ChipID.Vendor == "RiseRiseRise") this->ChipManufacturer = Rise; // Rise + else if (this->ChipID.Vendor == "GenuineTMx86") this->ChipManufacturer = Transmeta; // Transmeta + else if (this->ChipID.Vendor == "TransmetaCPU") this->ChipManufacturer = Transmeta; // Transmeta + else if (this->ChipID.Vendor == "Geode By NSC") this->ChipManufacturer = NSC; // National Semiconductor + else if (this->ChipID.Vendor == "Sun") this->ChipManufacturer = Sun; // Sun Microelectronics + else if (this->ChipID.Vendor == "IBM") this->ChipManufacturer = IBM; // IBM Microelectronics + else if (this->ChipID.Vendor == "Motorola") this->ChipManufacturer = Motorola; // Motorola Microelectronics + else this->ChipManufacturer = UnknownManufacturer; // Unknown manufacturer } @@ -1094,10 +1102,12 @@ bool SystemInformationImplementation::RetrieveCPUIdentity() } // Process the returned information. - memcpy (this->ChipID.Vendor, &(localCPUVendor[0]), sizeof (int)); - memcpy (&(this->ChipID.Vendor[4]), &(localCPUVendor[1]), sizeof (int)); - memcpy (&(this->ChipID.Vendor[8]), &(localCPUVendor[2]), sizeof (int)); - this->ChipID.Vendor[12] = '\0'; + char vbuf[13]; + memcpy (&(vbuf[0]), &(localCPUVendor[0]), sizeof (int)); + memcpy (&(vbuf[4]), &(localCPUVendor[1]), sizeof (int)); + memcpy (&(vbuf[8]), &(localCPUVendor[2]), sizeof (int)); + vbuf[12] = '\0'; + this->ChipID.Vendor = vbuf; this->FindManufacturer(); @@ -1546,17 +1556,17 @@ bool SystemInformationImplementation::RetrieveClassicalCPUClockSpeed() if (this->ChipID.Family == 3) { // 80386 processors.... Loop time is 115 cycles! - dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 115) / dDifference) / 1048576); + dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 115) / dDifference) / 1000000); } else if (this->ChipID.Family == 4) { // 80486 processors.... Loop time is 47 cycles! - dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 47) / dDifference) / 1048576); + dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 47) / dDifference) / 1000000); } else if (this->ChipID.Family == 5) { // Pentium processors.... Loop time is 43 cycles! - dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 43) / dDifference) / 1048576); + dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 43) / dDifference) / 1000000); } // Save the clock speed. @@ -1792,7 +1802,8 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber() } // Process the returned information. - sprintf (this->ChipID.SerialNumber, "%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x", + char sn[128]; + sprintf (sn, "%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x", ((SerialNumber[0] & 0xff000000) >> 24), ((SerialNumber[0] & 0x00ff0000) >> 16), ((SerialNumber[0] & 0x0000ff00) >> 8), @@ -1805,7 +1816,7 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber() ((SerialNumber[2] & 0x00ff0000) >> 16), ((SerialNumber[2] & 0x0000ff00) >> 8), ((SerialNumber[2] & 0x000000ff) >> 0)); - + this->ChipID.SerialNumber = sn; return true; #else @@ -1873,6 +1884,15 @@ bool SystemInformationImplementation::RetrieveCPUPowerManagement() #endif } +void SystemInformationStripLeadingSpace(kwsys_stl::string& str) +{ + // Because some manufacturers have leading white space - we have to post-process the name. + kwsys_stl::string::size_type pos = str.find_first_not_of(" "); + if(pos != kwsys_stl::string::npos) + { + str = str.substr(pos); + } +} /** */ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity() @@ -1886,7 +1906,6 @@ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity() return false; #if USE_ASM_INSTRUCTIONS - int ProcessorNameStartPos = 0; int CPUExtendedIdentity[12]; // Use assembly to detect CPUID information... @@ -1942,47 +1961,25 @@ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity() } // Process the returned information. - memcpy (this->ChipID.ProcessorName, &(CPUExtendedIdentity[0]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[4]), &(CPUExtendedIdentity[1]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[8]), &(CPUExtendedIdentity[2]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[12]), &(CPUExtendedIdentity[3]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[16]), &(CPUExtendedIdentity[4]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[20]), &(CPUExtendedIdentity[5]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[24]), &(CPUExtendedIdentity[6]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[28]), &(CPUExtendedIdentity[7]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[32]), &(CPUExtendedIdentity[8]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[36]), &(CPUExtendedIdentity[9]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[40]), &(CPUExtendedIdentity[10]), sizeof (int)); - memcpy (&(this->ChipID.ProcessorName[44]), &(CPUExtendedIdentity[11]), sizeof (int)); - this->ChipID.ProcessorName[48] = '\0'; + char nbuf[49]; + memcpy (&(nbuf[0]), &(CPUExtendedIdentity[0]), sizeof (int)); + memcpy (&(nbuf[4]), &(CPUExtendedIdentity[1]), sizeof (int)); + memcpy (&(nbuf[8]), &(CPUExtendedIdentity[2]), sizeof (int)); + memcpy (&(nbuf[12]), &(CPUExtendedIdentity[3]), sizeof (int)); + memcpy (&(nbuf[16]), &(CPUExtendedIdentity[4]), sizeof (int)); + memcpy (&(nbuf[20]), &(CPUExtendedIdentity[5]), sizeof (int)); + memcpy (&(nbuf[24]), &(CPUExtendedIdentity[6]), sizeof (int)); + memcpy (&(nbuf[28]), &(CPUExtendedIdentity[7]), sizeof (int)); + memcpy (&(nbuf[32]), &(CPUExtendedIdentity[8]), sizeof (int)); + memcpy (&(nbuf[36]), &(CPUExtendedIdentity[9]), sizeof (int)); + memcpy (&(nbuf[40]), &(CPUExtendedIdentity[10]), sizeof (int)); + memcpy (&(nbuf[44]), &(CPUExtendedIdentity[11]), sizeof (int)); + nbuf[48] = '\0'; + this->ChipID.ProcessorName = nbuf; // Because some manufacturers have leading white space - we have to post-process the name. - if (this->ChipManufacturer == Intel) - { - for (int nCounter = 0; nCounter < CHIPNAME_STRING_LENGTH; nCounter ++) - { - // There will either be NULL (\0) or spaces ( ) as the leading characters. - if ((this->ChipID.ProcessorName[nCounter] != '\0') && (this->ChipID.ProcessorName[nCounter] != ' ')) - { - // We have found the starting position of the name. - ProcessorNameStartPos = nCounter; - // Terminate the loop. - break; - } - } - - // Check to see if there is any white space at the start. - if (ProcessorNameStartPos == 0) - { - return true; - } - - // Now move the name forward so that there is no white space. - memmove(this->ChipID.ProcessorName, &(this->ChipID.ProcessorName[ProcessorNameStartPos]), (CHIPNAME_STRING_LENGTH - ProcessorNameStartPos)); - } - + SystemInformationStripLeadingSpace(this->ChipID.ProcessorName); return true; - #else return false; #endif @@ -1999,53 +1996,53 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() // Check the family / model / revision to determine the CPU ID. switch (this->ChipID.Family) { case 3: - sprintf (this->ChipID.ProcessorName, "Newer i80386 family"); + this->ChipID.ProcessorName = "Newer i80386 family"; break; case 4: switch (this->ChipID.Model) { - case 0: sprintf (this->ChipID.ProcessorName,"i80486DX-25/33"); break; - case 1: sprintf (this->ChipID.ProcessorName,"i80486DX-50"); break; - case 2: sprintf (this->ChipID.ProcessorName,"i80486SX"); break; - case 3: sprintf (this->ChipID.ProcessorName,"i80486DX2"); break; - case 4: sprintf (this->ChipID.ProcessorName,"i80486SL"); break; - case 5: sprintf (this->ChipID.ProcessorName,"i80486SX2"); break; - case 7: sprintf (this->ChipID.ProcessorName,"i80486DX2 WriteBack"); break; - case 8: sprintf (this->ChipID.ProcessorName,"i80486DX4"); break; - case 9: sprintf (this->ChipID.ProcessorName,"i80486DX4 WriteBack"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown 80486 family"); return false; + case 0: this->ChipID.ProcessorName = "i80486DX-25/33"; break; + case 1: this->ChipID.ProcessorName = "i80486DX-50"; break; + case 2: this->ChipID.ProcessorName = "i80486SX"; break; + case 3: this->ChipID.ProcessorName = "i80486DX2"; break; + case 4: this->ChipID.ProcessorName = "i80486SL"; break; + case 5: this->ChipID.ProcessorName = "i80486SX2"; break; + case 7: this->ChipID.ProcessorName = "i80486DX2 WriteBack"; break; + case 8: this->ChipID.ProcessorName = "i80486DX4"; break; + case 9: this->ChipID.ProcessorName = "i80486DX4 WriteBack"; break; + default: this->ChipID.ProcessorName = "Unknown 80486 family"; return false; } break; case 5: switch (this->ChipID.Model) { - case 0: sprintf (this->ChipID.ProcessorName,"P5 A-Step"); break; - case 1: sprintf (this->ChipID.ProcessorName,"P5"); break; - case 2: sprintf (this->ChipID.ProcessorName,"P54C"); break; - case 3: sprintf (this->ChipID.ProcessorName,"P24T OverDrive"); break; - case 4: sprintf (this->ChipID.ProcessorName,"P55C"); break; - case 7: sprintf (this->ChipID.ProcessorName,"P54C"); break; - case 8: sprintf (this->ChipID.ProcessorName,"P55C (0.25micron)"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown Pentium family"); return false; + case 0: this->ChipID.ProcessorName = "P5 A-Step"; break; + case 1: this->ChipID.ProcessorName = "P5"; break; + case 2: this->ChipID.ProcessorName = "P54C"; break; + case 3: this->ChipID.ProcessorName = "P24T OverDrive"; break; + case 4: this->ChipID.ProcessorName = "P55C"; break; + case 7: this->ChipID.ProcessorName = "P54C"; break; + case 8: this->ChipID.ProcessorName = "P55C (0.25micron)"; break; + default: this->ChipID.ProcessorName = "Unknown Pentium family"; return false; } break; case 6: switch (this->ChipID.Model) { - case 0: sprintf (this->ChipID.ProcessorName,"P6 A-Step"); break; - case 1: sprintf (this->ChipID.ProcessorName,"P6"); break; - case 3: sprintf (this->ChipID.ProcessorName,"Pentium II (0.28 micron)"); break; - case 5: sprintf (this->ChipID.ProcessorName,"Pentium II (0.25 micron)"); break; - case 6: sprintf (this->ChipID.ProcessorName,"Pentium II With On-Die L2 Cache"); break; - case 7: sprintf (this->ChipID.ProcessorName,"Pentium III (0.25 micron)"); break; - case 8: sprintf (this->ChipID.ProcessorName,"Pentium III (0.18 micron) With 256 KB On-Die L2 Cache "); break; - case 0xa: sprintf (this->ChipID.ProcessorName,"Pentium III (0.18 micron) With 1 Or 2 MB On-Die L2 Cache "); break; - case 0xb: sprintf (this->ChipID.ProcessorName,"Pentium III (0.13 micron) With 256 Or 512 KB On-Die L2 Cache "); break; - case 23: sprintf (this->ChipID.ProcessorName, "Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown P6 family"); return false; + case 0: this->ChipID.ProcessorName = "P6 A-Step"; break; + case 1: this->ChipID.ProcessorName = "P6"; break; + case 3: this->ChipID.ProcessorName = "Pentium II (0.28 micron)"; break; + case 5: this->ChipID.ProcessorName = "Pentium II (0.25 micron)"; break; + case 6: this->ChipID.ProcessorName = "Pentium II With On-Die L2 Cache"; break; + case 7: this->ChipID.ProcessorName = "Pentium III (0.25 micron)"; break; + case 8: this->ChipID.ProcessorName = "Pentium III (0.18 micron) With 256 KB On-Die L2 Cache "; break; + case 0xa: this->ChipID.ProcessorName = "Pentium III (0.18 micron) With 1 Or 2 MB On-Die L2 Cache "; break; + case 0xb: this->ChipID.ProcessorName = "Pentium III (0.13 micron) With 256 Or 512 KB On-Die L2 Cache "; break; + case 23: this->ChipID.ProcessorName = "Intel(R) Core(TM)2 Duo CPU T9500 @ 2.60GHz"; break; + default: this->ChipID.ProcessorName = "Unknown P6 family"; return false; } break; case 7: - sprintf (this->ChipID.ProcessorName,"Intel Merced (IA-64)"); + this->ChipID.ProcessorName = "Intel Merced (IA-64)"; break; case 0xf: // Check the extended family bits... @@ -2054,21 +2051,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() case 0: switch (this->ChipID.Model) { - case 0: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.18 micron)"); break; - case 1: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.18 micron)"); break; - case 2: sprintf (this->ChipID.ProcessorName,"Pentium IV (0.13 micron)"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown Pentium 4 family"); return false; + case 0: this->ChipID.ProcessorName = "Pentium IV (0.18 micron)"; break; + case 1: this->ChipID.ProcessorName = "Pentium IV (0.18 micron)"; break; + case 2: this->ChipID.ProcessorName = "Pentium IV (0.13 micron)"; break; + default: this->ChipID.ProcessorName = "Unknown Pentium 4 family"; return false; } break; case 1: - sprintf (this->ChipID.ProcessorName,"Intel McKinley (IA-64)"); + this->ChipID.ProcessorName = "Intel McKinley (IA-64)"; break; default: - sprintf (this->ChipID.ProcessorName,"Pentium"); + this->ChipID.ProcessorName = "Pentium"; } break; default: - sprintf (this->ChipID.ProcessorName,"Unknown Intel family"); + this->ChipID.ProcessorName = "Unknown Intel family"; return false; } break; @@ -2080,49 +2077,49 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() case 4: switch (this->ChipID.Model) { - case 3: sprintf (this->ChipID.ProcessorName,"80486DX2"); break; - case 7: sprintf (this->ChipID.ProcessorName,"80486DX2 WriteBack"); break; - case 8: sprintf (this->ChipID.ProcessorName,"80486DX4"); break; - case 9: sprintf (this->ChipID.ProcessorName,"80486DX4 WriteBack"); break; - case 0xe: sprintf (this->ChipID.ProcessorName,"5x86"); break; - case 0xf: sprintf (this->ChipID.ProcessorName,"5x86WB"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown 80486 family"); return false; + case 3: this->ChipID.ProcessorName = "80486DX2"; break; + case 7: this->ChipID.ProcessorName = "80486DX2 WriteBack"; break; + case 8: this->ChipID.ProcessorName = "80486DX4"; break; + case 9: this->ChipID.ProcessorName = "80486DX4 WriteBack"; break; + case 0xe: this->ChipID.ProcessorName = "5x86"; break; + case 0xf: this->ChipID.ProcessorName = "5x86WB"; break; + default: this->ChipID.ProcessorName = "Unknown 80486 family"; return false; } break; case 5: switch (this->ChipID.Model) { - case 0: sprintf (this->ChipID.ProcessorName,"SSA5 (PR75, PR90, PR100)"); break; - case 1: sprintf (this->ChipID.ProcessorName,"5k86 (PR120, PR133)"); break; - case 2: sprintf (this->ChipID.ProcessorName,"5k86 (PR166)"); break; - case 3: sprintf (this->ChipID.ProcessorName,"5k86 (PR200)"); break; - case 6: sprintf (this->ChipID.ProcessorName,"K6 (0.30 micron)"); break; - case 7: sprintf (this->ChipID.ProcessorName,"K6 (0.25 micron)"); break; - case 8: sprintf (this->ChipID.ProcessorName,"K6-2"); break; - case 9: sprintf (this->ChipID.ProcessorName,"K6-III"); break; - case 0xd: sprintf (this->ChipID.ProcessorName,"K6-2+ or K6-III+ (0.18 micron)"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown 80586 family"); return false; + case 0: this->ChipID.ProcessorName = "SSA5 (PR75, PR90 = PR100)"; break; + case 1: this->ChipID.ProcessorName = "5k86 (PR120 = PR133)"; break; + case 2: this->ChipID.ProcessorName = "5k86 (PR166)"; break; + case 3: this->ChipID.ProcessorName = "5k86 (PR200)"; break; + case 6: this->ChipID.ProcessorName = "K6 (0.30 micron)"; break; + case 7: this->ChipID.ProcessorName = "K6 (0.25 micron)"; break; + case 8: this->ChipID.ProcessorName = "K6-2"; break; + case 9: this->ChipID.ProcessorName = "K6-III"; break; + case 0xd: this->ChipID.ProcessorName = "K6-2+ or K6-III+ (0.18 micron)"; break; + default: this->ChipID.ProcessorName = "Unknown 80586 family"; return false; } break; case 6: switch (this->ChipID.Model) { - case 1: sprintf (this->ChipID.ProcessorName,"Athlon- (0.25 micron)"); break; - case 2: sprintf (this->ChipID.ProcessorName,"Athlon- (0.18 micron)"); break; - case 3: sprintf (this->ChipID.ProcessorName,"Duron- (SF core)"); break; - case 4: sprintf (this->ChipID.ProcessorName,"Athlon- (Thunderbird core)"); break; - case 6: sprintf (this->ChipID.ProcessorName,"Athlon- (Palomino core)"); break; - case 7: sprintf (this->ChipID.ProcessorName,"Duron- (Morgan core)"); break; + case 1: this->ChipID.ProcessorName = "Athlon- (0.25 micron)"; break; + case 2: this->ChipID.ProcessorName = "Athlon- (0.18 micron)"; break; + case 3: this->ChipID.ProcessorName = "Duron- (SF core)"; break; + case 4: this->ChipID.ProcessorName = "Athlon- (Thunderbird core)"; break; + case 6: this->ChipID.ProcessorName = "Athlon- (Palomino core)"; break; + case 7: this->ChipID.ProcessorName = "Duron- (Morgan core)"; break; case 8: if (this->Features.ExtendedFeatures.SupportsMP) - sprintf (this->ChipID.ProcessorName,"Athlon - MP (Thoroughbred core)"); - else sprintf (this->ChipID.ProcessorName,"Athlon - XP (Thoroughbred core)"); + this->ChipID.ProcessorName = "Athlon - MP (Thoroughbred core)"; + else this->ChipID.ProcessorName = "Athlon - XP (Thoroughbred core)"; break; - default: sprintf (this->ChipID.ProcessorName,"Unknown K7 family"); return false; + default: this->ChipID.ProcessorName = "Unknown K7 family"; return false; } break; default: - sprintf (this->ChipID.ProcessorName,"Unknown AMD family"); + this->ChipID.ProcessorName = "Unknown AMD family"; return false; } break; @@ -2133,12 +2130,12 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() case 5: switch (this->ChipID.Model) { - case 4: sprintf (this->ChipID.ProcessorName,"Crusoe TM3x00 and TM5x00"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown Crusoe family"); return false; + case 4: this->ChipID.ProcessorName = "Crusoe TM3x00 and TM5x00"; break; + default: this->ChipID.ProcessorName = "Unknown Crusoe family"; return false; } break; default: - sprintf (this->ChipID.ProcessorName,"Unknown Transmeta family"); + this->ChipID.ProcessorName = "Unknown Transmeta family"; return false; } break; @@ -2149,13 +2146,13 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() case 5: switch (this->ChipID.Model) { - case 0: sprintf (this->ChipID.ProcessorName,"mP6 (0.25 micron)"); break; - case 2: sprintf (this->ChipID.ProcessorName,"mP6 (0.18 micron)"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown Rise family"); return false; + case 0: this->ChipID.ProcessorName = "mP6 (0.25 micron)"; break; + case 2: this->ChipID.ProcessorName = "mP6 (0.18 micron)"; break; + default: this->ChipID.ProcessorName = "Unknown Rise family"; return false; } break; default: - sprintf (this->ChipID.ProcessorName,"Unknown Rise family"); + this->ChipID.ProcessorName = "Unknown Rise family"; return false; } break; @@ -2166,13 +2163,13 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() case 4: switch (this->ChipID.Model) { - case 1: sprintf (this->ChipID.ProcessorName,"U5D"); break; - case 2: sprintf (this->ChipID.ProcessorName,"U5S"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown UMC family"); return false; + case 1: this->ChipID.ProcessorName = "U5D"; break; + case 2: this->ChipID.ProcessorName = "U5S"; break; + default: this->ChipID.ProcessorName = "Unknown UMC family"; return false; } break; default: - sprintf (this->ChipID.ProcessorName,"Unknown UMC family"); + this->ChipID.ProcessorName = "Unknown UMC family"; return false; } break; @@ -2183,21 +2180,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() case 5: switch (this->ChipID.Model) { - case 4: sprintf (this->ChipID.ProcessorName,"C6"); break; - case 8: sprintf (this->ChipID.ProcessorName,"C2"); break; - case 9: sprintf (this->ChipID.ProcessorName,"C3"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family"); return false; + case 4: this->ChipID.ProcessorName = "C6"; break; + case 8: this->ChipID.ProcessorName = "C2"; break; + case 9: this->ChipID.ProcessorName = "C3"; break; + default: this->ChipID.ProcessorName = "Unknown IDT\\Centaur family"; return false; } break; case 6: switch (this->ChipID.Model) { - case 6: sprintf (this->ChipID.ProcessorName,"VIA Cyrix III - Samuel"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family"); return false; + case 6: this->ChipID.ProcessorName = "VIA Cyrix III - Samuel"; break; + default: this->ChipID.ProcessorName = "Unknown IDT\\Centaur family"; return false; } break; default: - sprintf (this->ChipID.ProcessorName,"Unknown IDT\\Centaur family"); + this->ChipID.ProcessorName = "Unknown IDT\\Centaur family"; return false; } break; @@ -2208,32 +2205,32 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() case 4: switch (this->ChipID.Model) { - case 4: sprintf (this->ChipID.ProcessorName,"MediaGX GX, GXm"); break; - case 9: sprintf (this->ChipID.ProcessorName,"5x86"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown Cx5x86 family"); return false; + case 4: this->ChipID.ProcessorName = "MediaGX GX = GXm"; break; + case 9: this->ChipID.ProcessorName = "5x86"; break; + default: this->ChipID.ProcessorName = "Unknown Cx5x86 family"; return false; } break; case 5: switch (this->ChipID.Model) { - case 2: sprintf (this->ChipID.ProcessorName,"Cx6x86"); break; - case 4: sprintf (this->ChipID.ProcessorName,"MediaGX GXm"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown Cx6x86 family"); return false; + case 2: this->ChipID.ProcessorName = "Cx6x86"; break; + case 4: this->ChipID.ProcessorName = "MediaGX GXm"; break; + default: this->ChipID.ProcessorName = "Unknown Cx6x86 family"; return false; } break; case 6: switch (this->ChipID.Model) { - case 0: sprintf (this->ChipID.ProcessorName,"6x86MX"); break; - case 5: sprintf (this->ChipID.ProcessorName,"Cyrix M2 Core"); break; - case 6: sprintf (this->ChipID.ProcessorName,"WinChip C5A Core"); break; - case 7: sprintf (this->ChipID.ProcessorName,"WinChip C5B\\C5C Core"); break; - case 8: sprintf (this->ChipID.ProcessorName,"WinChip C5C-T Core"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown 6x86MX\\Cyrix III family"); return false; + case 0: this->ChipID.ProcessorName = "6x86MX"; break; + case 5: this->ChipID.ProcessorName = "Cyrix M2 Core"; break; + case 6: this->ChipID.ProcessorName = "WinChip C5A Core"; break; + case 7: this->ChipID.ProcessorName = "WinChip C5B\\C5C Core"; break; + case 8: this->ChipID.ProcessorName = "WinChip C5C-T Core"; break; + default: this->ChipID.ProcessorName = "Unknown 6x86MX\\Cyrix III family"; return false; } break; default: - sprintf (this->ChipID.ProcessorName,"Unknown Cyrix family"); + this->ChipID.ProcessorName = "Unknown Cyrix family"; return false; } break; @@ -2244,21 +2241,21 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() case 5: switch (this->ChipID.Model) { - case 0: sprintf (this->ChipID.ProcessorName,"Nx586 or Nx586FPU"); break; - default: sprintf (this->ChipID.ProcessorName,"Unknown NexGen family"); return false; + case 0: this->ChipID.ProcessorName = "Nx586 or Nx586FPU"; break; + default: this->ChipID.ProcessorName = "Unknown NexGen family"; return false; } break; default: - sprintf (this->ChipID.ProcessorName,"Unknown NexGen family"); + this->ChipID.ProcessorName = "Unknown NexGen family"; return false; } break; case NSC: - sprintf (this->ChipID.ProcessorName,"Cx486SLC \\ DLC \\ Cx486S A-Step"); + this->ChipID.ProcessorName = "Cx486SLC \\ DLC \\ Cx486S A-Step"; break; default: - sprintf (this->ChipID.ProcessorName,"Unknown family"); // We cannot identify the processor. + this->ChipID.ProcessorName = "Unknown family"; // We cannot identify the processor. return false; } @@ -2365,7 +2362,7 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() this->ChipID.Family = atoi(this->ExtractValueFromCpuInfoFile(buffer,"cpu family").c_str()); // Chip Vendor - strcpy(this->ChipID.Vendor,this->ExtractValueFromCpuInfoFile(buffer,"vendor_id").c_str()); + this->ChipID.Vendor = this->ExtractValueFromCpuInfoFile(buffer,"vendor_id"); this->FindManufacturer(); // Chip Model @@ -2945,7 +2942,7 @@ bool SystemInformationImplementation::ParseSysCtl() len = sizeof(value); sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0); - this->CPUSpeedInMHz = static_cast< float >( value )/ 1048576; + this->CPUSpeedInMHz = static_cast< float >( value )/ 1000000; // Chip family @@ -2964,7 +2961,7 @@ bool SystemInformationImplementation::ParseSysCtl() kwsys_stl::string machineBuf(retBuf); if (machineBuf.find_first_of("Power") != kwsys_stl::string::npos) { - strcpy(this->ChipID.Vendor, "IBM"); + this->ChipID.Vendor = "IBM"; len = 4; err = sysctlbyname("hw.cputype", &this->ChipID.Family, &len, NULL, 0); err = sysctlbyname("hw.cpusubtype", &this->ChipID.Model, &len, NULL, 0); @@ -2982,13 +2979,14 @@ bool SystemInformationImplementation::ParseSysCtl() len = 128; err = sysctlbyname("machdep.cpu.vendor", retBuf, &len, NULL, 0); // Chip Vendor - strcpy(this->ChipID.Vendor,retBuf); + this->ChipID.Vendor = retBuf; this->FindManufacturer(); - len=CHIPNAME_STRING_LENGTH; + ::memset(retBuf, 0, 128); err = sysctlbyname("machdep.cpu.brand_string", - this->ChipID.ProcessorName, &len, NULL, 0); + retBuf, &len, NULL, 0); + this->ChipID.ProcessorName = retBuf; // Chip Model len = sizeof(value); @@ -3175,11 +3173,11 @@ bool SystemInformationImplementation::QuerySolarisInfo() this->ChipID.Family = 0; // Chip Vendor - strcpy(this->ChipID.Vendor,"Sun"); + this->ChipID.Vendor = "Sun"; this->FindManufacturer(); // Chip Model - sprintf(this->ChipID.ProcessorName,"%s",this->ParseValueFromKStat("-s cpu_type").c_str()); + this->ChipID.ProcessorName = this->ParseValueFromKStat("-s cpu_type"); this->ChipID.Model = 0; // Cache size @@ -3233,7 +3231,7 @@ bool SystemInformationImplementation::QueryHaikuInfo() char vbuf[13]; strncpy(vbuf, cpu_info.eax_0.vendor_id, 12); vbuf[12] = '\0'; - strcpy(this->ChipID.Vendor,vbuf); + this->ChipID.Vendor = vbuf; this->FindManufacturer(); @@ -3274,6 +3272,89 @@ bool SystemInformationImplementation::QueryHaikuInfo() #endif } +bool SystemInformationImplementation::QueryQNXMemory() +{ +#if defined(__QNX__) + kwsys_stl::string buffer; + kwsys_stl::vector args; + args.clear(); + + args.push_back("showmem"); + args.push_back("-S"); + args.push_back(0); + buffer = this->RunProcess(args); + args.clear(); + + size_t pos = buffer.find("System RAM:"); + if (pos == buffer.npos) + return false; + pos = buffer.find(":", pos); + size_t pos2 = buffer.find("M (", pos); + if (pos2 == buffer.npos) + return false; + + pos++; + while (buffer[pos] == ' ') + pos++; + + this->TotalPhysicalMemory = atoi(buffer.substr(pos, pos2 - pos).c_str()); + return true; +#endif + return false; +} + +bool SystemInformationImplementation::QueryQNXProcessor() +{ +#if defined(__QNX__) + // the output on my QNX 6.4.1 looks like this: + // Processor1: 686 Pentium II Stepping 3 2175MHz FPU + kwsys_stl::string buffer; + kwsys_stl::vector args; + args.clear(); + + args.push_back("pidin"); + args.push_back("info"); + args.push_back(0); + buffer = this->RunProcess(args); + args.clear(); + + size_t pos = buffer.find("Processor1:"); + if (pos == buffer.npos) + return false; + + size_t pos2 = buffer.find("MHz", pos); + if (pos2 == buffer.npos) + return false; + + size_t pos3 = pos2; + while (buffer[pos3] != ' ') + --pos3; + + this->CPUSpeedInMHz = atoi(buffer.substr(pos3 + 1, pos2 - pos3 - 1).c_str()); + + pos2 = buffer.find(" Stepping", pos); + if (pos2 != buffer.npos) + { + pos2 = buffer.find(" ", pos2 + 1); + if (pos2 != buffer.npos && pos2 < pos3) + { + this->ChipID.Revision = atoi(buffer.substr(pos2 + 1, pos3 - pos2).c_str()); + } + } + + this->NumberOfPhysicalCPU = 0; + do + { + pos = buffer.find("\nProcessor", pos + 1); + ++this->NumberOfPhysicalCPU; + } while (pos != buffer.npos); + this->NumberOfLogicalCPU = 1; + + return true; +#else + return false; +#endif +} /** Query the operating system information */ bool SystemInformationImplementation::QueryOSInformation() @@ -3304,28 +3385,37 @@ bool SystemInformationImplementation::QueryOSInformation() { case VER_PLATFORM_WIN32_NT: // Test for the product. - if (osvi.dwMajorVersion <= 4) + if (osvi.dwMajorVersion <= 4) { this->OSRelease = "NT"; } - if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) + if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) { this->OSRelease = "2000"; } - if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + { + this->OSRelease = "XP"; + } + // XP Professional x64 + if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) { this->OSRelease = "XP"; } #ifdef VER_NT_WORKSTATION // Test for product type. - if (bOsVersionInfoEx) + if (bOsVersionInfoEx) { - if (osvi.wProductType == VER_NT_WORKSTATION) + if (osvi.wProductType == VER_NT_WORKSTATION) { - if (osvi.dwMajorVersion == 6) + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) { this->OSRelease = "Vista"; } + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1) + { + this->OSRelease = "7"; + } // VER_SUITE_PERSONAL may not be defined #ifdef VER_SUITE_PERSONAL else diff --git a/GCC_XML/KWSys/SystemTools.cxx b/GCC_XML/KWSys/SystemTools.cxx index 3153235..695949a 100644 --- a/GCC_XML/KWSys/SystemTools.cxx +++ b/GCC_XML/KWSys/SystemTools.cxx @@ -56,6 +56,7 @@ // support for realpath call #ifndef _WIN32 +#include #include #include #include @@ -281,71 +282,29 @@ extern int putenv (char *__string) __THROW; } #endif -/* Implement floattime() for various platforms */ -// Taken from Python 2.1.3 - -#if defined( _WIN32 ) && !defined( __CYGWIN__ ) -# include -# define HAVE_FTIME -# if defined( __BORLANDC__) -# define FTIME ftime -# define TIMEB timeb -# else // Visual studio? -# define FTIME _ftime -# define TIMEB _timeb -# endif -#elif defined( __CYGWIN__ ) || defined( __linux__ ) || defined(__APPLE__) -# include -# include -# define HAVE_GETTIMEOFDAY -#endif - namespace KWSYS_NAMESPACE { +double SystemTools::GetTime(void) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + return (429.4967296*ft.dwHighDateTime + + 0.0000001*ft.dwLowDateTime + - 11644473600.0); +#else + struct timeval t; + gettimeofday(&t, 0); + return 1.0*double(t.tv_sec) + 0.000001*double(t.tv_usec); +#endif +} + class SystemToolsTranslationMap : public kwsys_stl::map { }; - -double -SystemTools::GetTime(void) -{ - /* There are three ways to get the time: - (1) gettimeofday() -- resolution in microseconds - (2) ftime() -- resolution in milliseconds - (3) time() -- resolution in seconds - In all cases the return value is a float in seconds. - Since on some systems (e.g. SCO ODT 3.0) gettimeofday() may - fail, so we fall back on ftime() or time(). - Note: clock resolution does not imply clock accuracy! */ -#ifdef HAVE_GETTIMEOFDAY - { - struct timeval t; -#ifdef GETTIMEOFDAY_NO_TZ - if (gettimeofday(&t) == 0) -#else /* !GETTIMEOFDAY_NO_TZ */ - if (gettimeofday(&t, static_cast(NULL)) == 0) -#endif /* !GETTIMEOFDAY_NO_TZ */ - return static_cast(t.tv_sec) + - static_cast(t.tv_usec)*0.000001; - } -#endif /* !HAVE_GETTIMEOFDAY */ - { -#if defined(HAVE_FTIME) - struct TIMEB t; - ::FTIME(&t); - return static_cast(t.time) + - static_cast(t.millitm) * static_cast(0.001); -#else /* !HAVE_FTIME */ - time_t secs; - time(&secs); - return static_cast(secs); -#endif /* !HAVE_FTIME */ - } -} - // adds the elements of the env variable path to the arg passed in void SystemTools::GetPath(kwsys_stl::vector& path, const char* env) { @@ -378,9 +337,7 @@ void SystemTools::GetPath(kwsys_stl::vector& path, const char kwsys_stl::string::size_type endpos = pathEnv.find(pathSep, start); if(endpos != kwsys_stl::string::npos) { - kwsys_stl::string convertedPath; - Realpath(pathEnv.substr(start, endpos-start).c_str(), convertedPath); - path.push_back(convertedPath); + path.push_back(pathEnv.substr(start, endpos-start)); start = endpos+1; } else @@ -565,6 +522,14 @@ void SystemTools::ReplaceString(kwsys_stl::string& source, static DWORD SystemToolsMakeRegistryMode(DWORD mode, SystemTools::KeyWOW64 view) { + // only add the modes when on a system that supports Wow64. + static FARPROC wow64p = GetProcAddress(GetModuleHandle("kernel32"), + "IsWow64Process"); + if(wow64p == NULL) + { + return mode; + } + if(view == SystemTools::KeyWOW64_32) { return mode | KWSYS_ST_KEY_WOW64_32KEY; @@ -736,10 +701,11 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value, HKEY hKey; DWORD dwDummy; + char lpClass[] = ""; if(RegCreateKeyEx(primaryKey, second.c_str(), 0, - "", + lpClass, REG_OPTION_NON_VOLATILE, SystemToolsMakeRegistryMode(KEY_WRITE, view), NULL, @@ -1405,6 +1371,10 @@ kwsys_stl::vector SystemTools::SplitString(const char* p, char se { kwsys_stl::string path = p; kwsys_stl::vector paths; + if(path.empty()) + { + return paths; + } if(isPath && path[0] == '/') { path.erase(path.begin()); @@ -1638,7 +1608,7 @@ kwsys_stl::string SystemTools::ConvertToUnixOutputPath(const char* path) kwsys_stl::string ret = path; // remove // except at the beginning might be a cygwin drive - kwsys_stl::string::size_type pos=0; + kwsys_stl::string::size_type pos=1; while((pos = ret.find("//", pos)) != kwsys_stl::string::npos) { ret.erase(pos, 1); @@ -3059,39 +3029,50 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot static int GetCasePathName(const kwsys_stl::string & pathIn, kwsys_stl::string & casePath) { - kwsys_stl::string::size_type iFound = pathIn.rfind('/'); - if (iFound > 1 && iFound != pathIn.npos) + kwsys_stl::vector path_components; + SystemTools::SplitPath(pathIn.c_str(), path_components); + if(path_components[0].empty()) // First component always exists. { - // recurse to peel off components - // - if (GetCasePathName(pathIn.substr(0, iFound), casePath) > 0) - { - casePath += '/'; - if (pathIn[1] != '/') - { - WIN32_FIND_DATA findData; + // Relative paths cannot be converted. + casePath = ""; + return 0; + } - // append the long component name to the path - // - HANDLE hFind = ::FindFirstFile(pathIn.c_str(), &findData); - if (INVALID_HANDLE_VALUE != hFind) - { - casePath += findData.cFileName; - ::FindClose(hFind); - } - else - { - // if FindFirstFile fails, return the error code - // - casePath = ""; - return 0; - } - } - } + // Start with root component. + kwsys_stl::vector::size_type idx = 0; + casePath = path_components[idx++]; + const char* sep = ""; + + // If network path, fill casePath with server/share so FindFirstFile + // will work after that. Maybe someday call other APIs to get + // actual case of servers and shares. + if(path_components.size() > 2 && path_components[0] == "//") + { + casePath += path_components[idx++]; + casePath += "/"; + casePath += path_components[idx++]; + sep = "/"; } - else + + for(; idx < path_components.size(); idx++) { - casePath = pathIn; + casePath += sep; + sep = "/"; + kwsys_stl::string test_str = casePath; + test_str += path_components[idx]; + + WIN32_FIND_DATA findData; + HANDLE hFind = ::FindFirstFile(test_str.c_str(), &findData); + if (INVALID_HANDLE_VALUE != hFind) + { + casePath += findData.cFileName; + ::FindClose(hFind); + } + else + { + casePath = ""; + return 0; + } } return (int)casePath.size(); } @@ -3104,28 +3085,29 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p) #ifndef _WIN32 return p; #else + kwsys_stl::string casePath = p; + // make sure drive letter is always upper case + if(casePath.size() > 1 && casePath[1] == ':') + { + casePath[0] = toupper(casePath[0]); + } + // Check to see if actual case has already been called // for this path, and the result is stored in the LongPathMap - SystemToolsTranslationMap::iterator i = - SystemTools::LongPathMap->find(p); + SystemToolsTranslationMap::iterator i = + SystemTools::LongPathMap->find(casePath); if(i != SystemTools::LongPathMap->end()) { return i->second; } - kwsys_stl::string casePath; int len = GetCasePathName(p, casePath); if(len == 0 || len > MAX_PATH+1) { return p; } - // make sure drive letter is always upper case - if(casePath.size() > 1 && casePath[1] == ':') - { - casePath[0] = toupper(casePath[0]); - } (*SystemTools::LongPathMap)[p] = casePath; return casePath; -#endif +#endif } //---------------------------------------------------------------------------- @@ -3143,9 +3125,9 @@ const char* SystemTools::SplitPathRootComponent(const char* p, } c += 2; } - else if(c[0] == '/') + else if(c[0] == '/' || c[0] == '\\') { - // Unix path. + // Unix path (or Windows path w/out drive letter). if(root) { *root = "/"; @@ -4591,8 +4573,6 @@ void SystemTools::ClassInitialize() // for windows because drive letters need to be maintained. Also, // there are not sym-links and mount points on windows anyway. #if !defined(_WIN32) || defined(__CYGWIN__) - // Work-around an SGI problem by always adding this mapping: - SystemTools::AddTranslationPath("/tmp_mnt/", "/"); // The tmp path is frequently a logical path so always keep it: SystemTools::AddKeepPath("/tmp/"); diff --git a/GCC_XML/KWSys/SystemTools.hxx.in b/GCC_XML/KWSys/SystemTools.hxx.in index ec70320..fd2ed19 100644 --- a/GCC_XML/KWSys/SystemTools.hxx.in +++ b/GCC_XML/KWSys/SystemTools.hxx.in @@ -372,8 +372,8 @@ public: * "c:/" = Windows full path (can be any drive letter) * "c:" = Windows drive-letter relative path (can be any drive letter) * "//" = Network path - * "~" = Home path for current user - * "~u" = Home path for user 'u' + * "~/" = Home path for current user + * "~u/" = Home path for user 'u' * "" = Relative path * * A pointer to the rest of the path after the root component is @@ -385,7 +385,7 @@ public: /** * Split a path name into its basic components. The first component - * is one of the roots returned by SplitPathRootComponent. + * always exists and is the root returned by SplitPathRootComponent. * The remaining components form the path. If there is a trailing * slash then the last component is the empty string. The * components can be recombined as "c[0]c[1]/c[2]/.../c[n]" to @@ -690,13 +690,7 @@ public: * ----------------------------------------------------------------- */ - /** - * Get current time as a double. On certain platforms this will - * return higher resolution than seconds: - * (1) gettimeofday() -- resolution in microseconds - * (2) ftime() -- resolution in milliseconds - * (3) time() -- resolution in seconds - */ + /** Get current time in seconds since Posix Epoch (Jan 1, 1970). */ static double GetTime(); /** diff --git a/GCC_XML/KWSys/Terminal.c b/GCC_XML/KWSys/Terminal.c index 3bf2579..25832c2 100644 --- a/GCC_XML/KWSys/Terminal.c +++ b/GCC_XML/KWSys/Terminal.c @@ -160,8 +160,10 @@ static const char* kwsysTerminalVT100Names[] = "rxvt-cygwin", "rxvt-cygwin-native", "rxvt-unicode", + "rxvt-unicode-256color", "screen", "screen-256color", + "screen-256color-bce", "screen-bce", "screen-w", "screen.linux", diff --git a/GCC_XML/KWSys/hash_fun.hxx.in b/GCC_XML/KWSys/hash_fun.hxx.in index f21efc5..8c5eb6a 100644 --- a/GCC_XML/KWSys/hash_fun.hxx.in +++ b/GCC_XML/KWSys/hash_fun.hxx.in @@ -38,8 +38,9 @@ #define @KWSYS_NAMESPACE@_hash_fun_hxx #include <@KWSYS_NAMESPACE@/Configure.hxx> - +#include <@KWSYS_NAMESPACE@/FundamentalType.h> #include <@KWSYS_NAMESPACE@/cstddef> // size_t +#include <@KWSYS_NAMESPACE@/stl/string> // string namespace @KWSYS_NAMESPACE@ { @@ -65,6 +66,18 @@ struct hash { size_t operator()(const char* __s) const { return _stl_hash_string(__s); } }; +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION + struct hash<@KWSYS_NAMESPACE@_stl::string> { + size_t operator()(const @KWSYS_NAMESPACE@_stl::string & __s) const { return _stl_hash_string(__s.c_str()); } +}; + +#if !defined(__BORLANDC__) +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION + struct hash { + size_t operator()(const @KWSYS_NAMESPACE@_stl::string & __s) const { return _stl_hash_string(__s.c_str()); } +}; +#endif + @KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION struct hash { size_t operator()(char __x) const { return __x; } @@ -110,6 +123,28 @@ struct hash { size_t operator()(unsigned long __x) const { return __x; } }; +// use long long or __int64 +#if @KWSYS_NAMESPACE@_USE_LONG_LONG +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash { + size_t operator()(long long __x) const { return __x; } +}; + +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash { + size_t operator()(unsigned long long __x) const { return __x; } +}; +#elif @KWSYS_NAMESPACE@_USE___INT64 +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<__int64> { + size_t operator()(__int64 __x) const { return __x; } +}; +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash { + size_t operator()(unsigned __int64 __x) const { return __x; } +}; +#endif // use long long or __int64 + } // namespace @KWSYS_NAMESPACE@ #endif diff --git a/GCC_XML/KWSys/kwsysDateStamp.cmake b/GCC_XML/KWSys/kwsysDateStamp.cmake index 41520c6..79825b2 100644 --- a/GCC_XML/KWSys/kwsysDateStamp.cmake +++ b/GCC_XML/KWSys/kwsysDateStamp.cmake @@ -12,10 +12,10 @@ #============================================================================= # KWSys version date year component. Format is CCYY. -SET(KWSYS_DATE_STAMP_YEAR 2010) +SET(KWSYS_DATE_STAMP_YEAR 2011) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 07) +SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 09) +SET(KWSYS_DATE_STAMP_DAY 07) diff --git a/GCC_XML/KWSys/testSystemTools.cxx b/GCC_XML/KWSys/testSystemTools.cxx index ad35c34..c0e74af 100644 --- a/GCC_XML/KWSys/testSystemTools.cxx +++ b/GCC_XML/KWSys/testSystemTools.cxx @@ -297,7 +297,7 @@ bool CheckStringOperations() if (kwsys::SystemTools::ConvertToUnixOutputPath ("//Local Mojo/Hex Power Pack/Iffy Voodoo") != - "/Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo") + "//Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo") { kwsys_ios::cerr << "Problem with ConvertToUnixOutputPath " diff --git a/GCC_XML/Support/GCC/3.4/emmintrin.h b/GCC_XML/Support/GCC/3.4/emmintrin.h new file mode 100644 index 0000000..e0a8394 --- /dev/null +++ b/GCC_XML/Support/GCC/3.4/emmintrin.h @@ -0,0 +1,939 @@ +/* Copyright (C) 2003, 2004 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifdef __SSE2__ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((mode (V2DF))); +typedef int __v2di __attribute__ ((mode (V2DI))); +typedef int __v4si __attribute__ ((mode (V4SI))); +typedef int __v8hi __attribute__ ((mode (V8HI))); +typedef int __v16qi __attribute__ ((mode (V16QI))); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +#define __m128i __v2di +#define __m128d __v2df + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128d +_mm_load_sd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +static __inline __m128d +_mm_load1_pd (double const *__P) +; + +static __inline __m128d +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128d +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128d +_mm_loadu_pd (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +static __inline __m128d +_mm_loadr_pd (double const *__P) +; + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128d +_mm_set_sd (double __F) +; + +/* Create a vector with all two elements equal to F. */ +static __inline __m128d +_mm_set1_pd (double __F) +; + +static __inline __m128d +_mm_set_pd1 (double __F) +; + +/* Create the vector [Z Y]. */ +static __inline __m128d +_mm_set_pd (double __Z, double __Y) +; + +/* Create the vector [Y Z]. */ +static __inline __m128d +_mm_setr_pd (double __Z, double __Y) +; + +/* Create a vector of zeros. */ +static __inline __m128d +_mm_setzero_pd (void) +; + +/* Stores the lower DPFP value. */ +static __inline void +_mm_store_sd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. */ +static __inline void +_mm_store1_pd (double *__P, __m128d __A) +; + +static __inline void +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +static __inline void +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +static __inline void +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +static __inline void +_mm_storer_pd (double *__P, __m128d __A) +; + +/* Sets the low DPFP value of A from the low value of B. */ +static __inline __m128d +_mm_move_sd (__m128d __A, __m128d __B) +; + + +static __inline __m128d +_mm_add_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_add_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_sub_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_sub_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_mul_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_mul_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_div_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_div_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +static __inline __m128d +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_min_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_min_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_max_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_max_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_and_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_or_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_xor_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comile_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comige_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +static __inline __m128i +_mm_load_si128 (__m128i const *__P) +; + +static __inline __m128i +_mm_loadu_si128 (__m128i const *__P) +; + +static __inline __m128i +_mm_loadl_epi64 (__m128i const *__P) +; + +static __inline void +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +static __inline void +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +static __inline void +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; + +static __inline __m64 +_mm_movepi64_pi64 (__m128i __B) +; + +static __inline __m128i +_mm_move_epi64 (__m128i __A) +; + +/* Create a vector of zeros. */ +static __inline __m128i +_mm_setzero_si128 (void) +; + +static __inline __m128i +_mm_set_epi64 (__m64 __A, __m64 __B) +; + +/* Create the vector [Z Y X W]. */ +static __inline __m128i +_mm_set_epi32 (int __Z, int __Y, int __X, int __W) +; + +#ifdef __x86_64__ +/* Create the vector [Z Y]. */ +static __inline __m128i +_mm_set_epi64x (long long __Z, long long __Y) +; +#endif + +/* Create the vector [S T U V Z Y X W]. */ +static __inline __m128i +_mm_set_epi16 (short __Z, short __Y, short __X, short __W, + short __V, short __U, short __T, short __S) +; + +/* Create the vector [S T U V Z Y X W]. */ +static __inline __m128i +_mm_set_epi8 (char __Z, char __Y, char __X, char __W, + char __V, char __U, char __T, char __S, + char __Z1, char __Y1, char __X1, char __W1, + char __V1, char __U1, char __T1, char __S1) +; + +static __inline __m128i +_mm_set1_epi64 (__m64 __A) +; + +static __inline __m128i +_mm_set1_epi32 (int __A) +; + +#ifdef __x86_64__ +static __inline __m128i +_mm_set1_epi64x (long long __A) +; +#endif + +static __inline __m128i +_mm_set1_epi16 (short __A) +; + +static __inline __m128i +_mm_set1_epi8 (char __A) +; + +static __inline __m128i +_mm_setr_epi64 (__m64 __A, __m64 __B) +; + +/* Create the vector [Z Y X W]. */ +static __inline __m128i +_mm_setr_epi32 (int __W, int __X, int __Y, int __Z) +; +/* Create the vector [S T U V Z Y X W]. */ +static __inline __m128i +_mm_setr_epi16 (short __S, short __T, short __U, short __V, + short __W, short __X, short __Y, short __Z) +; + +/* Create the vector [S T U V Z Y X W]. */ +static __inline __m128i +_mm_setr_epi8 (char __S1, char __T1, char __U1, char __V1, + char __W1, char __X1, char __Y1, char __Z1, + char __S, char __T, char __U, char __V, + char __W, char __X, char __Y, char __Z) +; + +static __inline __m128d +_mm_cvtepi32_pd (__m128i __A) +; + +static __inline __m128 +_mm_cvtepi32_ps (__m128i __A) +; + +static __inline __m128i +_mm_cvtpd_epi32 (__m128d __A) +; + +static __inline __m64 +_mm_cvtpd_pi32 (__m128d __A) +; + +static __inline __m128 +_mm_cvtpd_ps (__m128d __A) +; + +static __inline __m128i +_mm_cvttpd_epi32 (__m128d __A) +; + +static __inline __m64 +_mm_cvttpd_pi32 (__m128d __A) +; + +static __inline __m128d +_mm_cvtpi32_pd (__m64 __A) +; + +static __inline __m128i +_mm_cvtps_epi32 (__m128 __A) +; + +static __inline __m128i +_mm_cvttps_epi32 (__m128 __A) +; + +static __inline __m128d +_mm_cvtps_pd (__m128 __A) +; + +static __inline int +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +static __inline long long +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +static __inline int +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +static __inline long long +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +static __inline __m128 +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +static __inline __m128d +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +static __inline __m128d +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +static __inline __m128d +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (__C))) + +static __inline __m128d +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_loadh_pd (__m128d __A, double const *__B) +; + +static __inline void +_mm_storeh_pd (double *__A, __m128d __B) +; + +static __inline __m128d +_mm_loadl_pd (__m128d __A, double const *__B) +; + +static __inline void +_mm_storel_pd (double *__A, __m128d __B) +; + +static __inline int +_mm_movemask_pd (__m128d __A) +; + +static __inline __m128i +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m64 +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +static __inline __m128i +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_slli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_slli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_slli_epi64 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_srai_epi16 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_srai_epi32 (__m128i __A, int __B) +; + +#if 0 +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, const int __B) +; + +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, const int __B) +; +#endif +#define _mm_srli_si128(__A, __B) ((__m128i)__builtin_ia32_psrldqi128 (__A, __B)) +#define _mm_slli_si128(__A, __B) ((__m128i)__builtin_ia32_pslldqi128 (__A, __B)) + +static __inline __m128i +_mm_srli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_srli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_srli_epi64 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_and_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_or_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#define _mm_extract_epi16(__A, __B) __builtin_ia32_pextrw128 ((__v8hi)__A, __B) + +#define _mm_insert_epi16(__A, __B, __C) ((__m128i)__builtin_ia32_pinsrw128 ((__v8hi)__A, __B, __C)) + +static __inline __m128i +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +static __inline int +_mm_movemask_epi8 (__m128i __A) +; + +static __inline __m128i +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __B)) +#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B)) +#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B)) + +static __inline void +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +static __inline __m128i +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +static __inline void +_mm_stream_si32 (int *__A, int __B) +; + +static __inline void +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +static __inline void +_mm_stream_pd (double *__A, __m128d __B) +; + +static __inline __m128i +_mm_movpi64_epi64 (__m64 __A) +; + +static __inline void +_mm_clflush (void const *__A) +; + +static __inline void +_mm_lfence (void) +; + +static __inline void +_mm_mfence (void) +; + +static __inline __m128i +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +static __inline __m128i +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +static __inline int +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +static __inline long long +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/3.4/mmintrin.h b/GCC_XML/Support/GCC/3.4/mmintrin.h new file mode 100644 index 0000000..1f634c3 --- /dev/null +++ b/GCC_XML/Support/GCC/3.4/mmintrin.h @@ -0,0 +1,636 @@ +/* Copyright (C) 2002, 2003 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The data type intended for user use. */ +typedef int __m64 __attribute__ ((__mode__ (__V2SI__))); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__mode__ (__V2SI__))); +typedef int __v4hi __attribute__ ((__mode__ (__V4HI__))); +typedef int __v8qi __attribute__ ((__mode__ (__V8QI__))); + +/* Empty the multimedia state. */ +static __inline void +_mm_empty (void) +; + +static __inline void +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +static __inline __m64 +_mm_cvtsi32_si64 (int __i) +; + +static __inline __m64 +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ +static __inline __m64 +_mm_cvtsi64x_si64 (long long __i) +; + +/* Convert I to a __m64 object. */ +static __inline __m64 +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +static __inline int +_mm_cvtsi64_si32 (__m64 __i) +; + +static __inline int +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the lower 32 bits of the __m64 object into an integer. */ +static __inline long long +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +static __inline __m64 +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +static __inline __m64 +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +static __inline __m64 +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +static __inline __m64 +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +static __inline __m64 +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +static __inline __m64 +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +static __inline __m64 +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +static __inline __m64 +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +static __inline __m64 +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +static __inline __m64 +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +static __inline __m64 +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +static __inline __m64 +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +static __inline __m64 +_mm_add_si64 (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +static __inline __m64 +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +static __inline __m64 +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +static __inline __m64 +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +static __inline __m64 +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +static __inline __m64 +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +static __inline __m64 +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +static __inline __m64 +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +static __inline __m64 +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +static __inline __m64 +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psllw (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_slli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +static __inline __m64 +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_pslld (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_slli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +static __inline __m64 +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psllq (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_slli_si64 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psraw (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srai_pi16 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psrad (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srai_pi32 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psrlw (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psrld (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +static __inline __m64 +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psrlq (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srli_si64 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +static __inline __m64 +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +static __inline __m64 +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +static __inline __m64 +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +static __inline __m64 +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +static __inline __m64 +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +static __inline __m64 +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +static __inline __m64 +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +static __inline __m64 +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +static __inline __m64 +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +static __inline __m64 +_mm_setr_pi32 (int __i0, int __i1) +; + +static __inline __m64 +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +static __inline __m64 +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +static __inline __m64 +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +static __inline __m64 +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +static __inline __m64 +_mm_set1_pi8 (char __b) +; + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/3.4/xmmintrin.h b/GCC_XML/Support/GCC/3.4/xmmintrin.h new file mode 100644 index 0000000..16ca967 --- /dev/null +++ b/GCC_XML/Support/GCC/3.4/xmmintrin.h @@ -0,0 +1,840 @@ +/* Copyright (C) 2002, 2003, 2004 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* The data type intended for user use. */ +typedef float __m128 __attribute__ ((__mode__(__V4SF__))); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__mode__(__V4SF__))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +static __inline __m128 +_mm_add_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_sub_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_mul_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_div_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_sqrt_ss (__m128 __A) +; + +static __inline __m128 +_mm_rcp_ss (__m128 __A) +; + +static __inline __m128 +_mm_rsqrt_ss (__m128 __A) +; + +static __inline __m128 +_mm_min_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +static __inline __m128 +_mm_add_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_sub_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_mul_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_div_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_sqrt_ps (__m128 __A) +; + +static __inline __m128 +_mm_rcp_ps (__m128 __A) +; + +static __inline __m128 +_mm_rsqrt_ps (__m128 __A) +; + +static __inline __m128 +_mm_min_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +static __inline __m128 +_mm_and_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_or_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +static __inline __m128 +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +static __inline __m128 +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +static __inline int +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comile_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comige_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +static __inline int +_mm_cvtss_si32 (__m128 __A) +; + +static __inline int +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +static __inline long long +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +static __inline __m64 +_mm_cvtps_pi32 (__m128 __A) +; + +static __inline __m64 +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +static __inline int +_mm_cvttss_si32 (__m128 __A) +; + +static __inline int +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ +static __inline long long +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +static __inline __m64 +_mm_cvttps_pi32 (__m128 __A) +; + +static __inline __m64 +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +static __inline __m128 +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +static __inline __m128 +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ +static __inline __m128 +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +static __inline __m128 +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +static __inline __m128 +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +static __inline __m128 +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +static __inline __m128 +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +static __inline __m128 +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +static __inline __m128 +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +static __inline __m128 +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +static __inline __m64 +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +static __inline __m64 +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#if 0 +static __inline __m128 +_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) +#endif + + +/* Selects and interleaves the upper two SPFP values from A and B. */ +static __inline __m128 +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +static __inline __m128 +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +static __inline __m128 +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +static __inline void +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +static __inline __m128 +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +static __inline __m128 +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +static __inline __m128 +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +static __inline void +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +static __inline int +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +static __inline unsigned int +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +static __inline unsigned int +_MM_GET_EXCEPTION_STATE (void) +; + +static __inline unsigned int +_MM_GET_EXCEPTION_MASK (void) +; + +static __inline unsigned int +_MM_GET_ROUNDING_MODE (void) +; + +static __inline unsigned int +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +static __inline void +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +static __inline void +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +static __inline void +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +static __inline void +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +static __inline void +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128 +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +static __inline __m128 +_mm_load1_ps (float const *__P) +; + +static __inline __m128 +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128 +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128 +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +static __inline __m128 +_mm_loadr_ps (float const *__P) +; + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128 +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +static __inline __m128 +_mm_set1_ps (float __F) +; + +static __inline __m128 +_mm_set_ps1 (float __F) +; + +/* Create the vector [Z Y X W]. */ +static __inline __m128 +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +static __inline __m128 +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Create a vector of zeros. */ +static __inline __m128 +_mm_setzero_ps (void) +; + +/* Stores the lower SPFP value. */ +static __inline void +_mm_store_ss (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +static __inline void +_mm_store1_ps (float *__P, __m128 __A) +; + +static __inline void +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +static __inline void +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +static __inline void +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +static __inline void +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +static __inline __m128 +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#if 0 +static __inline int +_mm_extract_pi16 (__m64 __A, int __N) +; + +static __inline int +_m_pextrw (__m64 __A, int __N) +; +#else +#define _mm_extract_pi16(A, N) \ + __builtin_ia32_pextrw ((__v4hi)(A), (N)) +#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#if 0 +static __inline __m64 +_mm_insert_pi16 (__m64 __A, int __D, int __N) +; + +static __inline __m64 +_m_pinsrw (__m64 __A, int __D, int __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_pinsrw ((__v4hi)(A), (D), (N))) +#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +static __inline __m64 +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +static __inline __m64 +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +static __inline __m64 +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +static __inline __m64 +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +static __inline int +_mm_movemask_pi8 (__m64 __A) +; + +static __inline int +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#if 0 +static __inline __m64 +_mm_shuffle_pi16 (__m64 __A, int __N) +; + +static __inline __m64 +_m_pshufw (__m64 __A, int __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) +#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +static __inline void +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +static __inline void +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +static __inline __m64 +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +static __inline __m64 +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +static __inline __m64 +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#if 0 +static __inline void +_mm_prefetch (void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +static __inline void +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +static __inline void +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +static __inline void +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +static __inline void +_mm_pause (void) +; + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ + __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \ + __v4sf __t0 = __builtin_ia32_shufps (__r0, __r1, 0x44); \ + __v4sf __t2 = __builtin_ia32_shufps (__r0, __r1, 0xEE); \ + __v4sf __t1 = __builtin_ia32_shufps (__r2, __r3, 0x44); \ + __v4sf __t3 = __builtin_ia32_shufps (__r2, __r3, 0xEE); \ + (row0) = __builtin_ia32_shufps (__t0, __t1, 0x88); \ + (row1) = __builtin_ia32_shufps (__t0, __t1, 0xDD); \ + (row2) = __builtin_ia32_shufps (__t2, __t3, 0x88); \ + (row3) = __builtin_ia32_shufps (__t2, __t3, 0xDD); \ +} while (0) + +/* For backward source compatibility. */ +#include + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.0/emmintrin.h b/GCC_XML/Support/GCC/4.0/emmintrin.h new file mode 100644 index 0000000..c8e2b53 --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/emmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_emmintrin.h" +#else +# include "gccxml_gnu_emmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.0/gccxml_apple_emmintrin.h b/GCC_XML/Support/GCC/4.0/gccxml_apple_emmintrin.h new file mode 100644 index 0000000..c3e9b0f --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/gccxml_apple_emmintrin.h @@ -0,0 +1,1037 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2003, 2004, 2005, 2006 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifdef __SSE2__ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +typedef __v2di __m128i; +typedef __v2df __m128d; + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* APPLE LOCAL begin radar 4152603 */ +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_sd (double __F) +; + +/* Create a vector with both elements equal to F. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set1_pd (double __F) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_pd1 (double __F) +; + +/* Create a vector with the lower value X and upper value W. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_pd (double __W, double __X) +; + +/* Create a vector with the lower value W and upper value X. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_setr_pd (double __W, double __X) +; + +/* Create a vector of zeros. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_setzero_pd (void) +; + +/* Sets the low DPFP value of A from the low value of B. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_move_sd (__m128d __A, __m128d __B) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadu_pd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load1_pd (double const *__P) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_sd (double const *__P) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadr_pd (double const *__P) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Stores the lower DPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_sd (double *__P, __m128d __A) +; + +static __inline double __attribute__((__always_inline__)) +_mm_cvtsd_f64 (__m128d __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_storel_pd (double *__P, __m128d __A) +; + +/* Stores the upper DPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeh_pd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store1_pd (double *__P, __m128d __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storer_pd (double *__P, __m128d __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi128_si64 (__m128i __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +static __inline __m128d __attribute__((__always_inline__)) +_mm_add_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_add_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sub_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sub_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_mul_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_mul_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_div_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_div_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_min_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_min_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_max_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_max_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_and_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_or_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_xor_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comile_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comige_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector of Qi, where i is the element number. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi64x (long long __q1, long long __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi64 (__m64 __q1, __m64 __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +; + +/* APPLE LOCAL begin 4220129 */ +/* functions moved to end of file */ +/* APPLE LOCAL end 4220129 */ + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_load_si128 (__m128i const *__P) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_loadu_si128 (__m128i const *__P) +; + +/* APPLE LOCAL begin 4099020 */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_loadl_epi64 (__m128i const *__P) +; +/* APPLE LOCAL end 4099020 */ + +static __inline void __attribute__((__always_inline__)) +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +/* APPLE LOCAL begin 4099020 */ +static __inline void __attribute__((__always_inline__)) +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; +/* APPLE LOCAL end 4099020 */ + +static __inline __m64 __attribute__((__always_inline__)) +_mm_movepi64_pi64 (__m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_movpi64_epi64 (__m64 __A) +; + +/* APPLE LOCAL begin 4099020 */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_move_epi64 (__m128i __A) +; +/* APPLE LOCAL end 4099020 */ + +/* Create a vector of zeros. */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_setzero_si128 (void) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtepi32_pd (__m128i __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtepi32_ps (__m128i __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtpd_epi32 (__m128d __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtpd_pi32 (__m128d __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpd_ps (__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvttpd_epi32 (__m128d __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvttpd_pi32 (__m128d __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtpi32_pd (__m64 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtps_epi32 (__m128 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvttps_epi32 (__m128 __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtps_pd (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +static __inline int __attribute__((__always_inline__)) +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi64_sd (__m128d __A, long long __B) +; + +/* Microsoft intrinsic. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +/* APPLE LOCAL 5814283 */ +#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)(__A), (__v2df)(__B), (__C))) + +static __inline __m128d __attribute__((__always_inline__)) +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadh_pd (__m128d __A, double const *__B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadl_pd (__m128d __A, double const *__B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_movemask_pd (__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi64 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srai_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srai_epi32 (__m128i __A, int __B) +; + +#if 0 +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, const int __B) +; + +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, const int __B) +; +#else +#define _mm_srli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_psrldqi128 (__A, (__B) * 8)) +#define _mm_slli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_pslldqi128 (__A, (__B) * 8)) +#endif + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi64 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_and_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_or_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +; +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(A), (N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(A), (D), (N))) +#endif + +static __inline __m128i __attribute__((__always_inline__)) +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_movemask_epi8 (__m128i __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin 5814283 */ +#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__A), __B)) +#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__A), __B)) +#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)(__A), __B)) +/* APPLE LOCAL end 5814283 */ + +static __inline void __attribute__((__always_inline__)) +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_si32 (int *__A, int __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_pd (double *__A, __m128d __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_clflush (void const *__A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_lfence (void) +; + +static __inline void __attribute__((__always_inline__)) +_mm_mfence (void) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi64_si128 (long long __A) +; + +/* Microsoft intrinsic. */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_castpd_ps(__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_castpd_si128(__m128d __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_castps_pd(__m128 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_castps_si128(__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_castsi128_ps(__m128i __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_castsi128_pd(__m128i __A) +; +/* APPLE LOCAL end radar 4152603 */ + +/* APPLE LOCAL begin 4220129, 4286110 */ +/* Set all of the elements of the vector to A. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi64x (long long __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi64 (__m64 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi32 (int __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi16 (short __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi8 (char __A) +; +/* APPLE LOCAL end 4220129, 4286110 */ + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.0/gccxml_apple_mmintrin.h b/GCC_XML/Support/GCC/4.0/gccxml_apple_mmintrin.h new file mode 100644 index 0000000..66c8837 --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/gccxml_apple_mmintrin.h @@ -0,0 +1,669 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The data type intended for user use. */ +/* APPLE LOCAL 4505813 */ +typedef long long __m64 __attribute__ ((__vector_size__ (8))); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* Empty the multimedia state. */ +/* APPLE LOCAL begin radar 4152603 */ +static __inline void __attribute__((__always_inline__)) +_mm_empty (void) +; + +static __inline void __attribute__((__always_inline__)) +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi32_si64 (int __i) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ + +/* Intel intrinsic. */ +static __inline __m64 __attribute__((__always_inline__)) +_m_from_int64 (long long __i) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi64_m64 (long long __i) +; + +/* Microsoft intrinsic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi64x_si64 (long long __i) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvtsi64_si32 (__m64 __i) +; + +static __inline int __attribute__((__always_inline__)) +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_m_to_int64 (__m64 __i) +; + +static __inline long long __attribute__((__always_inline__)) +_mm_cvtm64_si64 (__m64 __i) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_si64 (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pslld (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllq (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_si64 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psraw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srai_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrad (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srai_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrld (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlq (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_si64 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi32 (int __i0, int __i1) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi8 (char __b) +; +/* APPLE LOCAL end radar 4152603 */ + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.0/gccxml_apple_xmmintrin.h b/GCC_XML/Support/GCC/4.0/gccxml_apple_xmmintrin.h new file mode 100644 index 0000000..f9cc416 --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/gccxml_apple_xmmintrin.h @@ -0,0 +1,870 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The data type intended for user use. */ +typedef float __m128 __attribute__ ((__vector_size__ (16))); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* Create a vector of zeros. */ +/* APPLE LOCAL begin radar 4152603 */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_setzero_ps (void) +; + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_add_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sub_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_mul_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_div_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sqrt_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rcp_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rsqrt_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_min_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_add_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sub_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_mul_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_div_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sqrt_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rcp_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rsqrt_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_min_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_and_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_or_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +static __inline int __attribute__((__always_inline__)) +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comile_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comige_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvtss_si32 (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi32 (__m128 __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvttss_si32 (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvttps_pi32 (__m128 __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ + +/* Intel intrinsic. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi64_ss (__m128 __A, long long __B) +; + +/* Microsoft intrinsic. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#if 0 +static __inline __m128 __attribute__((__always_inline__)) +_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) +#endif + + +/* Selects and interleaves the upper two SPFP values from A and B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +static __inline void __attribute__((__always_inline__)) +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +static __inline int __attribute__((__always_inline__)) +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +static __inline unsigned int __attribute__((__always_inline__)) +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_EXCEPTION_STATE (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_EXCEPTION_MASK (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_ROUNDING_MODE (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +static __inline void __attribute__((__always_inline__)) +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +static __inline void __attribute__((__always_inline__)) +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set1_ps (float __F) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ps1 (float __F) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load1_ps (float const *__P) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadr_ps (float const *__P) +; + +/* Create the vector [Z Y X W]. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Stores the lower SPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_ss (float *__P, __m128 __A) +; + +static __inline float __attribute__((__always_inline__)) +_mm_cvtss_f32 (__m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +static __inline void __attribute__((__always_inline__)) +_mm_store1_ps (float *__P, __m128 __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_pi16 (__m64 const __A, int const __N) +; + +static __inline int __attribute__((__always_inline__)) +_m_pextrw (__m64 const __A, int const __N) +; +#else +#define _mm_extract_pi16(A, N) __builtin_ia32_vec_ext_v4hi ((__v4hi)(A), (N)) +#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#if 0 +static __inline __m64 __attribute__((__always_inline__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(A), (D), (N))) +#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +static __inline int __attribute__((__always_inline__)) +_mm_movemask_pi8 (__m64 __A) +; + +static __inline int __attribute__((__always_inline__)) +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#if 0 +static __inline __m64 __attribute__((__always_inline__)) +_mm_shuffle_pi16 (__m64 __A, int __N) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pshufw (__m64 __A, int __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) +#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +static __inline void __attribute__((__always_inline__)) +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +static __inline void __attribute__((__always_inline__)) +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#if 0 +static __inline void __attribute__((__always_inline__)) +_mm_prefetch (void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +static __inline void __attribute__((__always_inline__)) +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +static __inline void __attribute__((__always_inline__)) +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +static __inline void __attribute__((__always_inline__)) +_mm_pause (void) +; +/* APPLE LOCAL end radar 4152603 */ + +/* APPPLE LOCAL begin radar 4109832 */ +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ +} while (0) +/* APPPLE LOCAL end radar 4109832 */ + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* For backward source compatibility. */ +#include + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.0/gccxml_gnu_emmintrin.h b/GCC_XML/Support/GCC/4.0/gccxml_gnu_emmintrin.h new file mode 100644 index 0000000..15e56f5 --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/gccxml_gnu_emmintrin.h @@ -0,0 +1,977 @@ +/* Copyright (C) 2003, 2004, 2005 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifdef __SSE2__ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +typedef __v2di __m128i; +typedef __v2df __m128d; + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128d +_mm_set_sd (double __F) +; + +/* Create a vector with both elements equal to F. */ +static __inline __m128d +_mm_set1_pd (double __F) +; + +static __inline __m128d +_mm_set_pd1 (double __F) +; + +/* Create a vector with the lower value X and upper value W. */ +static __inline __m128d +_mm_set_pd (double __W, double __X) +; + +/* Create a vector with the lower value W and upper value X. */ +static __inline __m128d +_mm_setr_pd (double __W, double __X) +; + +/* Create a vector of zeros. */ +static __inline __m128d +_mm_setzero_pd (void) +; + +/* Sets the low DPFP value of A from the low value of B. */ +static __inline __m128d +_mm_move_sd (__m128d __A, __m128d __B) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128d +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128d +_mm_loadu_pd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +static __inline __m128d +_mm_load1_pd (double const *__P) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128d +_mm_load_sd (double const *__P) +; + +static __inline __m128d +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +static __inline __m128d +_mm_loadr_pd (double const *__P) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +static __inline void +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +static __inline void +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Stores the lower DPFP value. */ +static __inline void +_mm_store_sd (double *__P, __m128d __A) +; + +static __inline void +_mm_storel_pd (double *__P, __m128d __A) +; + +/* Stores the upper DPFP value. */ +static __inline void +_mm_storeh_pd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +static __inline void +_mm_store1_pd (double *__P, __m128d __A) +; + +static __inline void +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +static __inline void +_mm_storer_pd (double *__P, __m128d __A) +; + +static __inline int +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +static __inline long long +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +static __inline __m128d +_mm_add_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_add_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_sub_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_sub_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_mul_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_mul_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_div_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_div_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +static __inline __m128d +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_min_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_min_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_max_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_max_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_and_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_or_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_xor_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comile_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comige_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +static __inline int +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector of Qi, where i is the element number. */ + +static __inline __m128i +_mm_set_epi64x (long long __q1, long long __q0) +; + +static __inline __m128i +_mm_set_epi64 (__m64 __q1, __m64 __q0) +; + +static __inline __m128i +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +; + +static __inline __m128i +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +; + +static __inline __m128i +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +; + +/* Set all of the elements of the vector to A. */ + +static __inline __m128i +_mm_set1_epi64x (long long __A) +; + +static __inline __m128i +_mm_set1_epi64 (__m64 __A) +; + +static __inline __m128i +_mm_set1_epi32 (int __A) +; + +static __inline __m128i +_mm_set1_epi16 (short __A) +; + +static __inline __m128i +_mm_set1_epi8 (char __A) +; + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +static __inline __m128i +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +; + +static __inline __m128i +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +; + +static __inline __m128i +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +; + +static __inline __m128i +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +static __inline __m128i +_mm_load_si128 (__m128i const *__P) +; + +static __inline __m128i +_mm_loadu_si128 (__m128i const *__P) +; + +static __inline __m128i +_mm_loadl_epi64 (__m128i const *__P) +; + +static __inline void +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +static __inline void +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +static __inline void +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; + +static __inline __m64 +_mm_movepi64_pi64 (__m128i __B) +; + +static __inline __m128i +_mm_movpi64_epi64 (__m64 __A) +; + +static __inline __m128i +_mm_move_epi64 (__m128i __A) +; + +/* Create a vector of zeros. */ +static __inline __m128i +_mm_setzero_si128 (void) +; + +static __inline __m128d +_mm_cvtepi32_pd (__m128i __A) +; + +static __inline __m128 +_mm_cvtepi32_ps (__m128i __A) +; + +static __inline __m128i +_mm_cvtpd_epi32 (__m128d __A) +; + +static __inline __m64 +_mm_cvtpd_pi32 (__m128d __A) +; + +static __inline __m128 +_mm_cvtpd_ps (__m128d __A) +; + +static __inline __m128i +_mm_cvttpd_epi32 (__m128d __A) +; + +static __inline __m64 +_mm_cvttpd_pi32 (__m128d __A) +; + +static __inline __m128d +_mm_cvtpi32_pd (__m64 __A) +; + +static __inline __m128i +_mm_cvtps_epi32 (__m128 __A) +; + +static __inline __m128i +_mm_cvttps_epi32 (__m128 __A) +; + +static __inline __m128d +_mm_cvtps_pd (__m128 __A) +; + +static __inline int +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +static __inline long long +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +static __inline int +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +static __inline long long +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +static __inline __m128 +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +static __inline __m128d +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +static __inline __m128d +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +static __inline __m128d +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (__C))) + +static __inline __m128d +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d +_mm_loadh_pd (__m128d __A, double const *__B) +; + +static __inline __m128d +_mm_loadl_pd (__m128d __A, double const *__B) +; + +static __inline int +_mm_movemask_pd (__m128d __A) +; + +static __inline __m128i +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m64 +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +static __inline __m128i +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_slli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_slli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_slli_epi64 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_srai_epi16 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_srai_epi32 (__m128i __A, int __B) +; + +#if 0 +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, const int __B) +; + +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, const int __B) +; +#else +#define _mm_srli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_psrldqi128 (__A, (__B) * 8)) +#define _mm_slli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_pslldqi128 (__A, (__B) * 8)) +#endif + +static __inline __m128i +_mm_srli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_srli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_srli_epi64 (__m128i __A, int __B) +; + +static __inline __m128i +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_and_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_or_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +; +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(A), (N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(A), (D), (N))) +#endif + +static __inline __m128i +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +static __inline int +_mm_movemask_epi8 (__m128i __A) +; + +static __inline __m128i +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __B)) +#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B)) +#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B)) + +static __inline void +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +static __inline __m128i +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +static __inline void +_mm_stream_si32 (int *__A, int __B) +; + +static __inline void +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +static __inline void +_mm_stream_pd (double *__A, __m128d __B) +; + +static __inline void +_mm_clflush (void const *__A) +; + +static __inline void +_mm_lfence (void) +; + +static __inline void +_mm_mfence (void) +; + +static __inline __m128i +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +static __inline __m128i +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +static __inline __m128 +_mm_castpd_ps(__m128d __A) +; + +static __inline __m128i +_mm_castpd_si128(__m128d __A) +; + +static __inline __m128d +_mm_castps_pd(__m128 __A) +; + +static __inline __m128i +_mm_castps_si128(__m128 __A) +; + +static __inline __m128 +_mm_castsi128_ps(__m128i __A) +; + +static __inline __m128d +_mm_castsi128_pd(__m128i __A) +; + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.0/gccxml_gnu_mmintrin.h b/GCC_XML/Support/GCC/4.0/gccxml_gnu_mmintrin.h new file mode 100644 index 0000000..cfde655 --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/gccxml_gnu_mmintrin.h @@ -0,0 +1,636 @@ +/* Copyright (C) 2002, 2003, 2004, 2005 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The data type intended for user use. */ +typedef int __m64 __attribute__ ((__vector_size__ (8))); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); + +/* Empty the multimedia state. */ +static __inline void +_mm_empty (void) +; + +static __inline void +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +static __inline __m64 +_mm_cvtsi32_si64 (int __i) +; + +static __inline __m64 +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ +static __inline __m64 +_mm_cvtsi64x_si64 (long long __i) +; + +/* Convert I to a __m64 object. */ +static __inline __m64 +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +static __inline int +_mm_cvtsi64_si32 (__m64 __i) +; + +static __inline int +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the lower 32 bits of the __m64 object into an integer. */ +static __inline long long +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +static __inline __m64 +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +static __inline __m64 +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +static __inline __m64 +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +static __inline __m64 +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +static __inline __m64 +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +static __inline __m64 +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +static __inline __m64 +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +static __inline __m64 +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +static __inline __m64 +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +static __inline __m64 +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +static __inline __m64 +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +static __inline __m64 +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +static __inline __m64 +_mm_add_si64 (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +static __inline __m64 +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +static __inline __m64 +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +static __inline __m64 +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +static __inline __m64 +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +static __inline __m64 +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +static __inline __m64 +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +static __inline __m64 +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +static __inline __m64 +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +static __inline __m64 +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psllw (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_slli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +static __inline __m64 +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_pslld (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_slli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +static __inline __m64 +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psllq (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_slli_si64 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psraw (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srai_pi16 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psrad (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srai_pi32 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psrlw (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psrld (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +static __inline __m64 +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 +_m_psrlq (__m64 __m, __m64 __count) +; + +static __inline __m64 +_mm_srli_si64 (__m64 __m, int __count) +; + +static __inline __m64 +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +static __inline __m64 +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +static __inline __m64 +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +static __inline __m64 +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +static __inline __m64 +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +static __inline __m64 +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +static __inline __m64 +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +static __inline __m64 +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +static __inline __m64 +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +static __inline __m64 +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +static __inline __m64 +_mm_setr_pi32 (int __i0, int __i1) +; + +static __inline __m64 +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +static __inline __m64 +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +static __inline __m64 +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +static __inline __m64 +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +static __inline __m64 +_mm_set1_pi8 (char __b) +; + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.0/gccxml_gnu_xmmintrin.h b/GCC_XML/Support/GCC/4.0/gccxml_gnu_xmmintrin.h new file mode 100644 index 0000000..f6aac35 --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/gccxml_gnu_xmmintrin.h @@ -0,0 +1,833 @@ +/* Copyright (C) 2002, 2003, 2004, 2005 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The data type intended for user use. */ +typedef float __m128 __attribute__ ((__vector_size__ (16))); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* Create a vector of zeros. */ +static __inline __m128 +_mm_setzero_ps (void) +; + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +static __inline __m128 +_mm_add_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_sub_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_mul_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_div_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_sqrt_ss (__m128 __A) +; + +static __inline __m128 +_mm_rcp_ss (__m128 __A) +; + +static __inline __m128 +_mm_rsqrt_ss (__m128 __A) +; + +static __inline __m128 +_mm_min_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +static __inline __m128 +_mm_add_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_sub_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_mul_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_div_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_sqrt_ps (__m128 __A) +; + +static __inline __m128 +_mm_rcp_ps (__m128 __A) +; + +static __inline __m128 +_mm_rsqrt_ps (__m128 __A) +; + +static __inline __m128 +_mm_min_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +static __inline __m128 +_mm_and_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_or_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +static __inline __m128 +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +static __inline __m128 +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +static __inline int +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comile_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comige_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +static __inline int +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +static __inline int +_mm_cvtss_si32 (__m128 __A) +; + +static __inline int +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +static __inline long long +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +static __inline __m64 +_mm_cvtps_pi32 (__m128 __A) +; + +static __inline __m64 +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +static __inline int +_mm_cvttss_si32 (__m128 __A) +; + +static __inline int +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ +static __inline long long +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +static __inline __m64 +_mm_cvttps_pi32 (__m128 __A) +; + +static __inline __m64 +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +static __inline __m128 +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +static __inline __m128 +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ +static __inline __m128 +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +static __inline __m128 +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +static __inline __m128 +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +static __inline __m128 +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +static __inline __m128 +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +static __inline __m128 +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +static __inline __m128 +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +static __inline __m128 +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +static __inline __m64 +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +static __inline __m64 +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#if 0 +static __inline __m128 +_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) +#endif + + +/* Selects and interleaves the upper two SPFP values from A and B. */ +static __inline __m128 +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +static __inline __m128 +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +static __inline __m128 +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +static __inline void +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +static __inline __m128 +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +static __inline __m128 +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +static __inline __m128 +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +static __inline void +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +static __inline int +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +static __inline unsigned int +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +static __inline unsigned int +_MM_GET_EXCEPTION_STATE (void) +; + +static __inline unsigned int +_MM_GET_EXCEPTION_MASK (void) +; + +static __inline unsigned int +_MM_GET_ROUNDING_MODE (void) +; + +static __inline unsigned int +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +static __inline void +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +static __inline void +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +static __inline void +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +static __inline void +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +static __inline void +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128 +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +static __inline __m128 +_mm_set1_ps (float __F) +; + +static __inline __m128 +_mm_set_ps1 (float __F) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128 +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +static __inline __m128 +_mm_load1_ps (float const *__P) +; + +static __inline __m128 +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128 +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128 +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +static __inline __m128 +_mm_loadr_ps (float const *__P) +; + +/* Create the vector [Z Y X W]. */ +static __inline __m128 +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +static __inline __m128 +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Stores the lower SPFP value. */ +static __inline void +_mm_store_ss (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +static __inline void +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +static __inline void +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +static __inline void +_mm_store1_ps (float *__P, __m128 __A) +; + +static __inline void +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +static __inline void +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +static __inline __m128 +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_pi16 (__m64 const __A, int const __N) +; + +static __inline int __attribute__((__always_inline__)) +_m_pextrw (__m64 const __A, int const __N) +; +#else +#define _mm_extract_pi16(A, N) __builtin_ia32_vec_ext_v4hi ((__v4hi)(A), (N)) +#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#if 0 +static __inline __m64 __attribute__((__always_inline__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(A), (D), (N))) +#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +static __inline __m64 +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +static __inline __m64 +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +static __inline __m64 +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +static __inline __m64 +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +static __inline int +_mm_movemask_pi8 (__m64 __A) +; + +static __inline int +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#if 0 +static __inline __m64 +_mm_shuffle_pi16 (__m64 __A, int __N) +; + +static __inline __m64 +_m_pshufw (__m64 __A, int __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) +#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +static __inline void +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +static __inline void +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +static __inline __m64 +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +static __inline __m64 +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +static __inline __m64 +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#if 0 +static __inline void +_mm_prefetch (void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +static __inline void +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +static __inline void +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +static __inline void +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +static __inline void +_mm_pause (void) +; + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ +} while (0) + +/* For backward source compatibility. */ +#include + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.0/mmintrin.h b/GCC_XML/Support/GCC/4.0/mmintrin.h new file mode 100644 index 0000000..5ae8ff8 --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/mmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_mmintrin.h" +#else +# include "gccxml_gnu_mmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.0/xmmintrin.h b/GCC_XML/Support/GCC/4.0/xmmintrin.h new file mode 100644 index 0000000..bfe5312 --- /dev/null +++ b/GCC_XML/Support/GCC/4.0/xmmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_xmmintrin.h" +#else +# include "gccxml_gnu_xmmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.1/emmintrin.h b/GCC_XML/Support/GCC/4.1/emmintrin.h new file mode 100644 index 0000000..c8e2b53 --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/emmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_emmintrin.h" +#else +# include "gccxml_gnu_emmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.1/gccxml_apple_emmintrin.h b/GCC_XML/Support/GCC/4.1/gccxml_apple_emmintrin.h new file mode 100644 index 0000000..70b57e7 --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/gccxml_apple_emmintrin.h @@ -0,0 +1,1509 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2003, 2004, 2005, 2006, 2007 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifdef __SSE2__ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* APPLE LOCAL begin radar 5618945 */ +#undef __STATIC_INLINE +#ifdef __GNUC_STDC_INLINE__ +#define __STATIC_INLINE __inline +#else +#define __STATIC_INLINE static __inline +#endif +/* APPLE LOCAL end radar 5618945 */ + +/* APPLE LOCAL begin radar 4152603 */ +/* Create a vector with element 0 as F and the rest zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_sd (double __F) +; + +/* Create a vector with both elements equal to F. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_pd (double __F) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pd1 (double __F) +; + +/* Create a vector with the lower value X and upper value W. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pd (double __W, double __X) +; + +/* Create a vector with the lower value W and upper value X. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_pd (double __W, double __X) +; + +/* Create a vector of zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setzero_pd (void) +; + +/* Sets the low DPFP value of A from the low value of B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_move_sd (__m128d __A, __m128d __B) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadu_pd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load1_pd (double const *__P) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_sd (double const *__P) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadr_pd (double const *__P) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Stores the lower DPFP value. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_sd (double *__P, __m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE double __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_f64 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storel_pd (double *__P, __m128d __A) +; + +/* Stores the upper DPFP value. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeh_pd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store1_pd (double *__P, __m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storer_pd (double *__P, __m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi128_si64 (__m128i __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_div_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_div_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_and_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_or_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_xor_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comile_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comige_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector of Qi, where i is the element number. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi64x (long long __q1, long long __q0) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi64 (__m64 __q1, __m64 __q0) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +; + +/* APPLE LOCAL begin 4220129 */ +/* functions moved to end of file */ +/* APPLE LOCAL end 4220129 */ + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_si128 (__m128i const *__P) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadu_si128 (__m128i const *__P) +; + +/* APPLE LOCAL begin 4099020 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadl_epi64 (__m128i const *__P) +; +/* APPLE LOCAL end 4099020 */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +/* APPLE LOCAL begin 4099020 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; +/* APPLE LOCAL end 4099020 */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movepi64_pi64 (__m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movpi64_epi64 (__m64 __A) +; + +/* APPLE LOCAL begin 4099020 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_move_epi64 (__m128i __A) +; +/* APPLE LOCAL end 4099020 */ + +/* Create a vector of zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setzero_si128 (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtepi32_pd (__m128i __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtepi32_ps (__m128i __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpd_epi32 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpd_pi32 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpd_ps (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttpd_epi32 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttpd_pi32 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi32_pd (__m64 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_epi32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttps_epi32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_pd (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_sd (__m128d __A, long long __B) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +/* APPLE LOCAL 5814283 */ +#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)(__A), (__v2df)(__B), (__C))) + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadh_pd (__m128d __A, double const *__B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadl_pd (__m128d __A, double const *__B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movemask_pd (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_epi16 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_epi32 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_epi64 (__m128i __A, int __B) +; +#else +#define _mm_slli_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) +#define _mm_slli_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) +#define _mm_slli_epi64(__A, __B) \ + ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) +#endif + +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srai_epi16 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srai_epi32 (__m128i __A, int __B) +; +#else +#define _mm_srai_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) +#define _mm_srai_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) +#endif + +#if 0 +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, int __B) +; + +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, int __B) +; +#else +/* APPLE LOCAL begin 5919583 */ +#define _mm_srli_si128 (__m128i)__builtin_ia32_psrldqi128_byteshift +#define _mm_slli_si128 (__m128i)__builtin_ia32_pslldqi128_byteshift +/* APPLE LOCAL end 5919583 */ +#endif + +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_epi16 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_epi32 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_epi64 (__m128i __A, int __B) +; +#else +#define _mm_srli_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psrlwi128 ((__v8hi)(__A), __B)) +#define _mm_srli_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_psrldi128 ((__v4si)(__A), __B)) +#define _mm_srli_epi64(__A, __B) \ + ((__m128i)__builtin_ia32_psrlqi128 ((__v4si)(__A), __B)) +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_and_si128 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_or_si128 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_extract_epi16 (__m128i const __A, int const __N) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +; +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(A), (N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(A), (D), (N))) +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movemask_epi8 (__m128i __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin 5814283 */ +#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__A), __B)) +#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__A), __B)) +#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)(__A), __B)) +/* APPLE LOCAL end 5814283 */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_si32 (int *__A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_pd (double *__A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_clflush (void const *__A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_lfence (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mfence (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_si128 (long long __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castpd_ps(__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castpd_si128(__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castps_pd(__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castps_si128(__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castsi128_ps(__m128i __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castsi128_pd(__m128i __A) +; +/* APPLE LOCAL end radar 4152603 */ + +/* APPLE LOCAL begin 4220129, 4286110 */ +/* Set all of the elements of the vector to A. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi64x (long long __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi64 (__m64 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi32 (int __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi16 (short __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi8 (char __A) +; +/* APPLE LOCAL end 4220129, 4286110 */ + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.1/gccxml_apple_mmintrin.h b/GCC_XML/Support/GCC/4.1/gccxml_apple_mmintrin.h new file mode 100644 index 0000000..12d11c7 --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/gccxml_apple_mmintrin.h @@ -0,0 +1,942 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +/* APPLE LOCAL 4505813 */ +typedef long long __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* APPLE LOCAL begin radar 5618945 */ +#undef __STATIC_INLINE +#ifdef __GNUC_STDC_INLINE__ +#define __STATIC_INLINE __inline +#else +#define __STATIC_INLINE static __inline +#endif +/* APPLE LOCAL end radar 5618945 */ + +/* Empty the multimedia state. */ +/* APPLE LOCAL begin radar 4152603 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_empty (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi32_si64 (int __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_from_int64 (long long __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_m64 (long long __i) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64x_si64 (long long __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_si32 (__m64 __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_to_int64 (__m64 __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtm64_si64 (__m64 __i) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psllw (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_pi16 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pslld (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_pi32 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psllq (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_si64 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psraw (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srai_pi16 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrad (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srai_pi32 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrlw (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_pi16 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrld (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_pi32 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrlq (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_si64 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_pi32 (int __i0, int __i1) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_pi8 (char __b) +; +/* APPLE LOCAL end radar 4152603 */ + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.1/gccxml_apple_xmmintrin.h b/GCC_XML/Support/GCC/4.1/gccxml_apple_xmmintrin.h new file mode 100644 index 0000000..ca2b9f1 --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/gccxml_apple_xmmintrin.h @@ -0,0 +1,1192 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +/* APPLE LOCAL begin xmmintrin.h for kernel 4123064 */ +#if __STDC_HOSTED__ +#include +#endif +/* APPLE LOCAL end xmmintrin.h for kernel 4123064 */ + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* APPLE LOCAL begin radar 5618945 */ +#undef __STATIC_INLINE +#ifdef __GNUC_STDC_INLINE__ +#define __STATIC_INLINE __inline +#else +#define __STATIC_INLINE static __inline +#endif +/* APPLE LOCAL end radar 5618945 */ + +/* Create a vector of zeros. */ +/* APPLE LOCAL begin radar 4152603 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setzero_ps (void) +; + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_div_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sqrt_ss (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_rcp_ss (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_rsqrt_ss (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_div_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sqrt_ps (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_rcp_ps (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_rsqrt_ps (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_and_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_or_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comile_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comige_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_si32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_pi32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttss_si32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttps_pi32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_ss (__m128 __A, long long __B) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) +#endif + + +/* Selects and interleaves the upper two SPFP values from A and B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_GET_EXCEPTION_STATE (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_GET_EXCEPTION_MASK (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_GET_ROUNDING_MODE (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as F and the rest zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_ps (float __F) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_ps1 (float __F) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load1_ps (float const *__P) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadr_ps (float const *__P) +; + +/* Create the vector [Z Y X W]. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Stores the lower SPFP value. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_ss (float *__P, __m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE float __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_f32 (__m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store1_ps (float *__P, __m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_extract_pi16 (__m64 const __A, int const __N) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pextrw (__m64 const __A, int const __N) +; +#else +#define _mm_extract_pi16(A, N) __builtin_ia32_vec_ext_v4hi ((__v4hi)(A), (N)) +#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pinsrw (__m64 const __A, int const __D, int const __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(A), (D), (N))) +#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movemask_pi8 (__m64 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_shuffle_pi16 (__m64 __A, int __N) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pshufw (__m64 __A, int __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) +#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_prefetch (void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_pause (void) +; +/* APPLE LOCAL end radar 4152603 */ + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ +} while (0) + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* For backward source compatibility. */ +#include + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.1/gccxml_gnu_emmintrin.h b/GCC_XML/Support/GCC/4.1/gccxml_gnu_emmintrin.h new file mode 100644 index 0000000..9894fb1 --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/gccxml_gnu_emmintrin.h @@ -0,0 +1,1010 @@ +/* Copyright (C) 2003, 2004, 2005, 2007 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifdef __SSE2__ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_sd (double __F) +; + +/* Create a vector with both elements equal to F. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set1_pd (double __F) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_pd1 (double __F) +; + +/* Create a vector with the lower value X and upper value W. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_pd (double __W, double __X) +; + +/* Create a vector with the lower value W and upper value X. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_setr_pd (double __W, double __X) +; + +/* Create a vector of zeros. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_setzero_pd (void) +; + +/* Sets the low DPFP value of A from the low value of B. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_move_sd (__m128d __A, __m128d __B) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadu_pd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load1_pd (double const *__P) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_sd (double const *__P) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadr_pd (double const *__P) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Stores the lower DPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_sd (double *__P, __m128d __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_storel_pd (double *__P, __m128d __A) +; + +/* Stores the upper DPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeh_pd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store1_pd (double *__P, __m128d __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storer_pd (double *__P, __m128d __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +static __inline __m128d __attribute__((__always_inline__)) +_mm_add_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_add_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sub_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sub_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_mul_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_mul_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_div_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_div_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_min_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_min_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_max_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_max_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_and_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_or_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_xor_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comile_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comige_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector of Qi, where i is the element number. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi64x (long long __q1, long long __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi64 (__m64 __q1, __m64 __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +; + +/* Set all of the elements of the vector to A. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi64x (long long __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi64 (__m64 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi32 (int __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi16 (short __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi8 (char __A) +; + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_load_si128 (__m128i const *__P) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_loadu_si128 (__m128i const *__P) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_loadl_epi64 (__m128i const *__P) +; + +static __inline void __attribute__((__always_inline__)) +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_movepi64_pi64 (__m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_movpi64_epi64 (__m64 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_move_epi64 (__m128i __A) +; + +/* Create a vector of zeros. */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_setzero_si128 (void) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtepi32_pd (__m128i __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtepi32_ps (__m128i __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtpd_epi32 (__m128d __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtpd_pi32 (__m128d __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpd_ps (__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvttpd_epi32 (__m128d __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvttpd_pi32 (__m128d __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtpi32_pd (__m64 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtps_epi32 (__m128 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvttps_epi32 (__m128 __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtps_pd (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__,__artificial__)) +_mm_cvtsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +static __inline int __attribute__((__always_inline__)) +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (__C))) + +static __inline __m128d __attribute__((__always_inline__)) +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadh_pd (__m128d __A, double const *__B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadl_pd (__m128d __A, double const *__B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_movemask_pd (__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +#if 0 +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi64 (__m128i __A, int __B) +; +#else +#define _mm_slli_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) +#define _mm_slli_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) +#define _mm_slli_epi64(__A, __B) \ + ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) +#endif + +#if 0 +static __inline __m128i __attribute__((__always_inline__)) +_mm_srai_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srai_epi32 (__m128i __A, int __B) +; +#else +#define _mm_srai_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) +#define _mm_srai_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) +#endif + +#if 0 +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, int __B) +; + +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, int __B) +; +#else +#define _mm_srli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_psrldqi128 (__A, (__B) * 8)) +#define _mm_slli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_pslldqi128 (__A, (__B) * 8)) +#endif + +#if 0 +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi64 (__m128i __A, int __B) +; +#else +#define _mm_srli_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psrlwi128 ((__v8hi)(__A), __B)) +#define _mm_srli_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_psrldi128 ((__v4si)(__A), __B)) +#define _mm_srli_epi64(__A, __B) \ + ((__m128i)__builtin_ia32_psrlqi128 ((__v4si)(__A), __B)) +#endif + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_and_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_or_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +; +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(A), (N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(A), (D), (N))) +#endif + +static __inline __m128i __attribute__((__always_inline__)) +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_movemask_epi8 (__m128i __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __B)) +#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B)) +#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B)) + +static __inline void __attribute__((__always_inline__)) +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_si32 (int *__A, int __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_pd (double *__A, __m128d __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_clflush (void const *__A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_lfence (void) +; + +static __inline void __attribute__((__always_inline__)) +_mm_mfence (void) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_castpd_ps(__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_castpd_si128(__m128d __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_castps_pd(__m128 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_castps_si128(__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_castsi128_ps(__m128i __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_castsi128_pd(__m128i __A) +; + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.1/gccxml_gnu_mmintrin.h b/GCC_XML/Support/GCC/4.1/gccxml_gnu_mmintrin.h new file mode 100644 index 0000000..f29d286 --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/gccxml_gnu_mmintrin.h @@ -0,0 +1,637 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2007 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); + +/* Empty the multimedia state. */ +static __inline void __attribute__((__always_inline__)) +_mm_empty (void) +; + +static __inline void __attribute__((__always_inline__)) +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi32_si64 (int __i) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi64x_si64 (long long __i) +; + +/* Convert I to a __m64 object. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvtsi64_si32 (__m64 __i) +; + +static __inline int __attribute__((__always_inline__)) +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the lower 32 bits of the __m64 object into an integer. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_si64 (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pslld (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllq (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_si64 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psraw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srai_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrad (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srai_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrld (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlq (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_si64 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi32 (int __i0, int __i1) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi8 (char __b) +; + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.1/gccxml_gnu_xmmintrin.h b/GCC_XML/Support/GCC/4.1/gccxml_gnu_xmmintrin.h new file mode 100644 index 0000000..cca01db --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/gccxml_gnu_xmmintrin.h @@ -0,0 +1,841 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2007 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 8.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* Create a vector of zeros. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_setzero_ps (void) +; + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_add_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sub_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_mul_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_div_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sqrt_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rcp_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rsqrt_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_min_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_add_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sub_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_mul_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_div_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sqrt_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rcp_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rsqrt_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_min_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_and_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_or_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +static __inline int __attribute__((__always_inline__)) +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comile_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comige_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvtss_si32 (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__,__artificial__)) +_mm_cvtss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi32 (__m128 __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvttss_si32 (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvttps_pi32 (__m128 __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#if 0 +static __inline __m128 __attribute__((__always_inline__)) +_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) +#endif + + +/* Selects and interleaves the upper two SPFP values from A and B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +static __inline void __attribute__((__always_inline__)) +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +static __inline int __attribute__((__always_inline__)) +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +static __inline unsigned int __attribute__((__always_inline__)) +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_EXCEPTION_STATE (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_EXCEPTION_MASK (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_ROUNDING_MODE (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +static __inline void __attribute__((__always_inline__)) +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +static __inline void __attribute__((__always_inline__)) +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set1_ps (float __F) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ps1 (float __F) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load1_ps (float const *__P) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadr_ps (float const *__P) +; + +/* Create the vector [Z Y X W]. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Stores the lower SPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_ss (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +static __inline void __attribute__((__always_inline__)) +_mm_store1_ps (float *__P, __m128 __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_pi16 (__m64 const __A, int const __N) +; + +static __inline int __attribute__((__always_inline__)) +_m_pextrw (__m64 const __A, int const __N) +; +#else +#define _mm_extract_pi16(A, N) __builtin_ia32_vec_ext_v4hi ((__v4hi)(A), (N)) +#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#if 0 +static __inline __m64 __attribute__((__always_inline__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(A), (D), (N))) +#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +static __inline int __attribute__((__always_inline__)) +_mm_movemask_pi8 (__m64 __A) +; + +static __inline int __attribute__((__always_inline__)) +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#if 0 +static __inline __m64 __attribute__((__always_inline__)) +_mm_shuffle_pi16 (__m64 __A, int __N) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pshufw (__m64 __A, int __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) +#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +static __inline void __attribute__((__always_inline__)) +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +static __inline void __attribute__((__always_inline__)) +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#if 0 +static __inline void __attribute__((__always_inline__)) +_mm_prefetch (void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +static __inline void __attribute__((__always_inline__)) +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +static __inline void __attribute__((__always_inline__)) +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +static __inline void __attribute__((__always_inline__)) +_mm_pause (void) +; + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ +} while (0) + +/* For backward source compatibility. */ +#include + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.1/mmintrin.h b/GCC_XML/Support/GCC/4.1/mmintrin.h new file mode 100644 index 0000000..5ae8ff8 --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/mmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_mmintrin.h" +#else +# include "gccxml_gnu_mmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.1/xmmintrin.h b/GCC_XML/Support/GCC/4.1/xmmintrin.h new file mode 100644 index 0000000..bfe5312 --- /dev/null +++ b/GCC_XML/Support/GCC/4.1/xmmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_xmmintrin.h" +#else +# include "gccxml_gnu_xmmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.2/emmintrin.h b/GCC_XML/Support/GCC/4.2/emmintrin.h new file mode 100644 index 0000000..c8e2b53 --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/emmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_emmintrin.h" +#else +# include "gccxml_gnu_emmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.2/gccxml_apple_emmintrin.h b/GCC_XML/Support/GCC/4.2/gccxml_apple_emmintrin.h new file mode 100644 index 0000000..70b57e7 --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/gccxml_apple_emmintrin.h @@ -0,0 +1,1509 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2003, 2004, 2005, 2006, 2007 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifdef __SSE2__ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* APPLE LOCAL begin radar 5618945 */ +#undef __STATIC_INLINE +#ifdef __GNUC_STDC_INLINE__ +#define __STATIC_INLINE __inline +#else +#define __STATIC_INLINE static __inline +#endif +/* APPLE LOCAL end radar 5618945 */ + +/* APPLE LOCAL begin radar 4152603 */ +/* Create a vector with element 0 as F and the rest zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_sd (double __F) +; + +/* Create a vector with both elements equal to F. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_pd (double __F) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pd1 (double __F) +; + +/* Create a vector with the lower value X and upper value W. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pd (double __W, double __X) +; + +/* Create a vector with the lower value W and upper value X. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_pd (double __W, double __X) +; + +/* Create a vector of zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setzero_pd (void) +; + +/* Sets the low DPFP value of A from the low value of B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_move_sd (__m128d __A, __m128d __B) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadu_pd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load1_pd (double const *__P) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_sd (double const *__P) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadr_pd (double const *__P) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Stores the lower DPFP value. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_sd (double *__P, __m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE double __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_f64 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storel_pd (double *__P, __m128d __A) +; + +/* Stores the upper DPFP value. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeh_pd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store1_pd (double *__P, __m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storer_pd (double *__P, __m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi128_si64 (__m128i __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_div_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_div_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_and_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_or_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_xor_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comile_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comige_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector of Qi, where i is the element number. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi64x (long long __q1, long long __q0) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi64 (__m64 __q1, __m64 __q0) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +; + +/* APPLE LOCAL begin 4220129 */ +/* functions moved to end of file */ +/* APPLE LOCAL end 4220129 */ + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_si128 (__m128i const *__P) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadu_si128 (__m128i const *__P) +; + +/* APPLE LOCAL begin 4099020 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadl_epi64 (__m128i const *__P) +; +/* APPLE LOCAL end 4099020 */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +/* APPLE LOCAL begin 4099020 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; +/* APPLE LOCAL end 4099020 */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movepi64_pi64 (__m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movpi64_epi64 (__m64 __A) +; + +/* APPLE LOCAL begin 4099020 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_move_epi64 (__m128i __A) +; +/* APPLE LOCAL end 4099020 */ + +/* Create a vector of zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setzero_si128 (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtepi32_pd (__m128i __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtepi32_ps (__m128i __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpd_epi32 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpd_pi32 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpd_ps (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttpd_epi32 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttpd_pi32 (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi32_pd (__m64 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_epi32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttps_epi32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_pd (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_sd (__m128d __A, long long __B) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +/* APPLE LOCAL 5814283 */ +#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)(__A), (__v2df)(__B), (__C))) + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadh_pd (__m128d __A, double const *__B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadl_pd (__m128d __A, double const *__B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movemask_pd (__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_epi16 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_epi32 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_epi64 (__m128i __A, int __B) +; +#else +#define _mm_slli_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) +#define _mm_slli_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) +#define _mm_slli_epi64(__A, __B) \ + ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) +#endif + +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srai_epi16 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srai_epi32 (__m128i __A, int __B) +; +#else +#define _mm_srai_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) +#define _mm_srai_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) +#endif + +#if 0 +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, int __B) +; + +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, int __B) +; +#else +/* APPLE LOCAL begin 5919583 */ +#define _mm_srli_si128 (__m128i)__builtin_ia32_psrldqi128_byteshift +#define _mm_slli_si128 (__m128i)__builtin_ia32_pslldqi128_byteshift +/* APPLE LOCAL end 5919583 */ +#endif + +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_epi16 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_epi32 (__m128i __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_epi64 (__m128i __A, int __B) +; +#else +#define _mm_srli_epi16(__A, __B) \ + ((__m128i)__builtin_ia32_psrlwi128 ((__v8hi)(__A), __B)) +#define _mm_srli_epi32(__A, __B) \ + ((__m128i)__builtin_ia32_psrldi128 ((__v4si)(__A), __B)) +#define _mm_srli_epi64(__A, __B) \ + ((__m128i)__builtin_ia32_psrlqi128 ((__v4si)(__A), __B)) +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_and_si128 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_or_si128 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_extract_epi16 (__m128i const __A, int const __N) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +; +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(A), (N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(A), (D), (N))) +#endif + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movemask_epi8 (__m128i __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin 5814283 */ +#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__A), __B)) +#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__A), __B)) +#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)(__A), __B)) +/* APPLE LOCAL end 5814283 */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_si32 (int *__A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_pd (double *__A, __m128d __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_clflush (void const *__A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_lfence (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mfence (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_si128 (long long __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castpd_ps(__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castpd_si128(__m128d __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castps_pd(__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castps_si128(__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castsi128_ps(__m128i __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128d __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_castsi128_pd(__m128i __A) +; +/* APPLE LOCAL end radar 4152603 */ + +/* APPLE LOCAL begin 4220129, 4286110 */ +/* Set all of the elements of the vector to A. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi64x (long long __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi64 (__m64 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi32 (int __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi16 (short __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128i __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_epi8 (char __A) +; +/* APPLE LOCAL end 4220129, 4286110 */ + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.2/gccxml_apple_mmintrin.h b/GCC_XML/Support/GCC/4.2/gccxml_apple_mmintrin.h new file mode 100644 index 0000000..12d11c7 --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/gccxml_apple_mmintrin.h @@ -0,0 +1,942 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +/* APPLE LOCAL 4505813 */ +typedef long long __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* APPLE LOCAL begin radar 5618945 */ +#undef __STATIC_INLINE +#ifdef __GNUC_STDC_INLINE__ +#define __STATIC_INLINE __inline +#else +#define __STATIC_INLINE static __inline +#endif +/* APPLE LOCAL end radar 5618945 */ + +/* Empty the multimedia state. */ +/* APPLE LOCAL begin radar 4152603 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_empty (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi32_si64 (int __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_from_int64 (long long __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_m64 (long long __i) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64x_si64 (long long __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_si32 (__m64 __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_to_int64 (__m64 __i) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtm64_si64 (__m64 __i) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psllw (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_pi16 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pslld (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_pi32 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psllq (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_slli_si64 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psraw (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srai_pi16 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrad (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srai_pi32 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrlw (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_pi16 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrld (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_pi32 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrlq (__m64 __m, __m64 __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_srli_si64 (__m64 __m, int __count) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_pi32 (int __i0, int __i1) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_pi8 (char __b) +; +/* APPLE LOCAL end radar 4152603 */ + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.2/gccxml_apple_xmmintrin.h b/GCC_XML/Support/GCC/4.2/gccxml_apple_xmmintrin.h new file mode 100644 index 0000000..ca2b9f1 --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/gccxml_apple_xmmintrin.h @@ -0,0 +1,1192 @@ +/* APPLE LOCAL file mainline 2005-06-30 Radar 4131077 */ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +/* APPLE LOCAL begin xmmintrin.h for kernel 4123064 */ +#if __STDC_HOSTED__ +#include +#endif +/* APPLE LOCAL end xmmintrin.h for kernel 4123064 */ + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#define __always_inline__ __always_inline__, __nodebug__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* APPLE LOCAL begin radar 5618945 */ +#undef __STATIC_INLINE +#ifdef __GNUC_STDC_INLINE__ +#define __STATIC_INLINE __inline +#else +#define __STATIC_INLINE static __inline +#endif +/* APPLE LOCAL end radar 5618945 */ + +/* Create a vector of zeros. */ +/* APPLE LOCAL begin radar 4152603 */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setzero_ps (void) +; + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_div_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sqrt_ss (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_rcp_ss (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_rsqrt_ss (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_add_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sub_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mul_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_div_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sqrt_ps (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_rcp_ps (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_rsqrt_ps (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_and_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_or_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comile_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comige_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_si32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_pi32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttss_si32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE long long __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvttps_pi32 (__m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ + +/* Intel intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64_ss (__m128 __A, long long __B) +; + +/* Microsoft intrinsic. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) +#endif + + +/* Selects and interleaves the upper two SPFP values from A and B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_GET_EXCEPTION_STATE (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_GET_EXCEPTION_MASK (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_GET_ROUNDING_MODE (void) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE unsigned int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as F and the rest zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set1_ps (float __F) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_ps1 (float __F) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load1_ps (float const *__P) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_loadr_ps (float const *__P) +; + +/* Create the vector [Z Y X W]. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Stores the lower SPFP value. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_ss (float *__P, __m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE float __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_cvtss_f32 (__m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store1_ps (float *__P, __m128 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m128 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_extract_pi16 (__m64 const __A, int const __N) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pextrw (__m64 const __A, int const __N) +; +#else +#define _mm_extract_pi16(A, N) __builtin_ia32_vec_ext_v4hi ((__v4hi)(A), (N)) +#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pinsrw (__m64 const __A, int const __D, int const __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(A), (D), (N))) +#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_movemask_pi8 (__m64 __A) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE int __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_shuffle_pi16 (__m64 __A, int __N) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pshufw (__m64 __A, int __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) +#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE __m64 __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#if 0 +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_prefetch (void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +/* APPLE LOCAL begin radar 5618945 */ +__STATIC_INLINE void __attribute__((__always_inline__)) +/* APPLE LOCAL end radar 5618945 */ +_mm_pause (void) +; +/* APPLE LOCAL end radar 4152603 */ + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ +} while (0) + +/* APPLE LOCAL begin nodebug inline 4152603 */ +#undef __always_inline__ +/* APPLE LOCAL end nodebug inline 4152603 */ + +/* For backward source compatibility. */ +#include + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.2/gccxml_builtins.h b/GCC_XML/Support/GCC/4.2/gccxml_builtins.h index 2f994e9..0bd9378 100644 --- a/GCC_XML/Support/GCC/4.2/gccxml_builtins.h +++ b/GCC_XML/Support/GCC/4.2/gccxml_builtins.h @@ -129,3 +129,8 @@ long double __complex__ __builtin_ctanhl(long double __complex__); float __complex__ __builtin_cpowf(float __complex__, float __complex__); double __complex__ __builtin_cpow(double __complex__, double __complex__); long double __complex__ __builtin_cpowl(long double __complex__, long double __complex__); + +#ifdef __llvm__ +extern unsigned int __builtin_bswap32(unsigned int _data); +extern unsigned long __builtin_bswap64(unsigned long _data); +#endif diff --git a/GCC_XML/Support/GCC/4.2/gccxml_gnu_emmintrin.h b/GCC_XML/Support/GCC/4.2/gccxml_gnu_emmintrin.h new file mode 100644 index 0000000..611e9a8 --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/gccxml_gnu_emmintrin.h @@ -0,0 +1,1013 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2007 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifdef __SSE2__ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_sd (double __F) +; + +/* Create a vector with both elements equal to F. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set1_pd (double __F) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_pd1 (double __F) +; + +/* Create a vector with the lower value X and upper value W. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_set_pd (double __W, double __X) +; + +/* Create a vector with the lower value W and upper value X. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_setr_pd (double __W, double __X) +; + +/* Create a vector of zeros. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_setzero_pd (void) +; + +/* Sets the low DPFP value of A from the low value of B. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_move_sd (__m128d __A, __m128d __B) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadu_pd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load1_pd (double const *__P) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_sd (double const *__P) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadr_pd (double const *__P) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Stores the lower DPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_sd (double *__P, __m128d __A) +; + +static __inline double __attribute__((__always_inline__)) +_mm_cvtsd_f64 (__m128d __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_storel_pd (double *__P, __m128d __A) +; + +/* Stores the upper DPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeh_pd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store1_pd (double *__P, __m128d __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storer_pd (double *__P, __m128d __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi128_si64 (__m128i __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +static __inline __m128d __attribute__((__always_inline__)) +_mm_add_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_add_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sub_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sub_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_mul_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_mul_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_div_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_div_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_min_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_min_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_max_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_max_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_and_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_or_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_xor_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comile_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comige_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector of Qi, where i is the element number. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi64x (long long __q1, long long __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi64 (__m64 __q1, __m64 __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +; + +/* Set all of the elements of the vector to A. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi64x (long long __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi64 (__m64 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi32 (int __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi16 (short __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_set1_epi8 (char __A) +; + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +static __inline __m128i __attribute__((__always_inline__)) +_mm_load_si128 (__m128i const *__P) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_loadu_si128 (__m128i const *__P) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_loadl_epi64 (__m128i const *__P) +; + +static __inline void __attribute__((__always_inline__)) +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_movepi64_pi64 (__m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_movpi64_epi64 (__m64 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_move_epi64 (__m128i __A) +; + +/* Create a vector of zeros. */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_setzero_si128 (void) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtepi32_pd (__m128i __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtepi32_ps (__m128i __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtpd_epi32 (__m128d __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtpd_pi32 (__m128d __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpd_ps (__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvttpd_epi32 (__m128d __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvttpd_pi32 (__m128d __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtpi32_pd (__m64 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtps_epi32 (__m128 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvttps_epi32 (__m128 __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtps_pd (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +static __inline int __attribute__((__always_inline__)) +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi64_sd (__m128d __A, long long __B) +; + +/* Microsoft intrinsic. */ +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +static __inline __m128d __attribute__((__always_inline__)) +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +#define _mm_shuffle_pd(__A, __B, __C) ((__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, (__C))) + +static __inline __m128d __attribute__((__always_inline__)) +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadh_pd (__m128d __A, double const *__B) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_loadl_pd (__m128d __A, double const *__B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_movemask_pd (__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_slli_epi64 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srai_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srai_epi32 (__m128i __A, int __B) +; + +#if 0 +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, int __B) +; + +static __m128i __attribute__((__always_inline__)) +_mm_srli_si128 (__m128i __A, int __B) +; +#else +#define _mm_srli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_psrldqi128 (__A, (__B) * 8)) +#define _mm_slli_si128(__A, __B) \ + ((__m128i)__builtin_ia32_pslldqi128 (__A, (__B) * 8)) +#endif + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi16 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi32 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srli_epi64 (__m128i __A, int __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_and_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_or_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +; +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(A), (N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(A), (D), (N))) +#endif + +static __inline __m128i __attribute__((__always_inline__)) +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_movemask_epi8 (__m128i __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +#define _mm_shufflehi_epi16(__A, __B) ((__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __B)) +#define _mm_shufflelo_epi16(__A, __B) ((__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __B)) +#define _mm_shuffle_epi32(__A, __B) ((__m128i)__builtin_ia32_pshufd ((__v4si)__A, __B)) + +static __inline void __attribute__((__always_inline__)) +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_si32 (int *__A, int __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_stream_pd (double *__A, __m128d __B) +; + +static __inline void __attribute__((__always_inline__)) +_mm_clflush (void const *__A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_lfence (void) +; + +static __inline void __attribute__((__always_inline__)) +_mm_mfence (void) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi64_si128 (long long __A) +; + +/* Microsoft intrinsic. */ +static __inline __m128i __attribute__((__always_inline__)) +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_castpd_ps(__m128d __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_castpd_si128(__m128d __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_castps_pd(__m128 __A) +; + +static __inline __m128i __attribute__((__always_inline__)) +_mm_castps_si128(__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_castsi128_ps(__m128i __A) +; + +static __inline __m128d __attribute__((__always_inline__)) +_mm_castsi128_pd(__m128i __A) +; + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.2/gccxml_gnu_mmintrin.h b/GCC_XML/Support/GCC/4.2/gccxml_gnu_mmintrin.h new file mode 100644 index 0000000..537009b --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/gccxml_gnu_mmintrin.h @@ -0,0 +1,663 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); + +/* Empty the multimedia state. */ +static __inline void __attribute__((__always_inline__)) +_mm_empty (void) +; + +static __inline void __attribute__((__always_inline__)) +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi32_si64 (int __i) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ + +/* Intel intrinsic. */ +static __inline __m64 __attribute__((__always_inline__)) +_m_from_int64 (long long __i) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi64_m64 (long long __i) +; + +/* Microsoft intrinsic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtsi64x_si64 (long long __i) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvtsi64_si32 (__m64 __i) +; + +static __inline int __attribute__((__always_inline__)) +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_m_to_int64 (__m64 __i) +; + +static __inline long long __attribute__((__always_inline__)) +_mm_cvtm64_si64 (__m64 __i) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +static __inline __m64 __attribute__((__always_inline__)) +_mm_add_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pslld (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllq (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_slli_si64 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psraw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srai_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrad (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srai_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlw (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_pi16 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrld (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_pi32 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlq (__m64 __m, __m64 __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_srli_si64 (__m64 __m, int __count) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi32 (int __i0, int __i1) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_set1_pi8 (char __b) +; + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.2/gccxml_gnu_xmmintrin.h b/GCC_XML/Support/GCC/4.2/gccxml_gnu_xmmintrin.h new file mode 100644 index 0000000..7ad3dac --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/gccxml_gnu_xmmintrin.h @@ -0,0 +1,860 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* Create a vector of zeros. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_setzero_ps (void) +; + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_add_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sub_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_mul_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_div_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sqrt_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rcp_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rsqrt_ss (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_min_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_add_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sub_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_mul_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_div_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_sqrt_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rcp_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_rsqrt_ps (__m128 __A) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_min_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_and_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_or_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +static __inline int __attribute__((__always_inline__)) +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comile_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comige_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +static __inline int __attribute__((__always_inline__)) +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvtss_si32 (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi32 (__m128 __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +static __inline int __attribute__((__always_inline__)) +_mm_cvttss_si32 (__m128 __A) +; + +static __inline int __attribute__((__always_inline__)) +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ + +/* Intel intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +static __inline long long __attribute__((__always_inline__)) +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvttps_pi32 (__m128 __A) +; + +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ + +/* Intel intrinsic. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi64_ss (__m128 __A, long long __B) +; + +/* Microsoft intrinsic. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#if 0 +static __inline __m128 __attribute__((__always_inline__)) +_mm_shuffle_ps (__m128 __A, __m128 __B, int __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(A), (__v4sf)(B), (MASK))) +#endif + + +/* Selects and interleaves the upper two SPFP values from A and B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +static __inline void __attribute__((__always_inline__)) +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +static __inline int __attribute__((__always_inline__)) +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +static __inline unsigned int __attribute__((__always_inline__)) +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_EXCEPTION_STATE (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_EXCEPTION_MASK (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_ROUNDING_MODE (void) +; + +static __inline unsigned int __attribute__((__always_inline__)) +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +static __inline void __attribute__((__always_inline__)) +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +static __inline void __attribute__((__always_inline__)) +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +static __inline void __attribute__((__always_inline__)) +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as F and the rest zero. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set1_ps (float __F) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ps1 (float __F) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load1_ps (float const *__P) +; + +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_loadr_ps (float const *__P) +; + +/* Create the vector [Z Y X W]. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Stores the lower SPFP value. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_ss (float *__P, __m128 __A) +; + +static __inline float __attribute__((__always_inline__)) +_mm_cvtss_f32 (__m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +static __inline void __attribute__((__always_inline__)) +_mm_store1_ps (float *__P, __m128 __A) +; + +static __inline void __attribute__((__always_inline__)) +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +static __inline __m128 __attribute__((__always_inline__)) +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#if 0 +static __inline int __attribute__((__always_inline__)) +_mm_extract_pi16 (__m64 const __A, int const __N) +; + +static __inline int __attribute__((__always_inline__)) +_m_pextrw (__m64 const __A, int const __N) +; +#else +#define _mm_extract_pi16(A, N) __builtin_ia32_vec_ext_v4hi ((__v4hi)(A), (N)) +#define _m_pextrw(A, N) _mm_extract_pi16((A), (N)) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#if 0 +static __inline __m64 __attribute__((__always_inline__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(A), (D), (N))) +#define _m_pinsrw(A, D, N) _mm_insert_pi16((A), (D), (N)) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +static __inline int __attribute__((__always_inline__)) +_mm_movemask_pi8 (__m64 __A) +; + +static __inline int __attribute__((__always_inline__)) +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#if 0 +static __inline __m64 __attribute__((__always_inline__)) +_mm_shuffle_pi16 (__m64 __A, int __N) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pshufw (__m64 __A, int __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(A), (N))) +#define _m_pshufw(A, N) _mm_shuffle_pi16 ((A), (N)) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +static __inline void __attribute__((__always_inline__)) +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +static __inline void __attribute__((__always_inline__)) +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +static __inline __m64 __attribute__((__always_inline__)) +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +static __inline __m64 __attribute__((__always_inline__)) +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#if 0 +static __inline void __attribute__((__always_inline__)) +_mm_prefetch (void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +static __inline void __attribute__((__always_inline__)) +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +static __inline void __attribute__((__always_inline__)) +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +static __inline void __attribute__((__always_inline__)) +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +static __inline void __attribute__((__always_inline__)) +_mm_pause (void) +; + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ +} while (0) + +/* For backward source compatibility. */ +#include + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.2/mmintrin.h b/GCC_XML/Support/GCC/4.2/mmintrin.h new file mode 100644 index 0000000..5ae8ff8 --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/mmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_mmintrin.h" +#else +# include "gccxml_gnu_mmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.2/xmmintrin.h b/GCC_XML/Support/GCC/4.2/xmmintrin.h new file mode 100644 index 0000000..bfe5312 --- /dev/null +++ b/GCC_XML/Support/GCC/4.2/xmmintrin.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +# include "gccxml_apple_xmmintrin.h" +#else +# include "gccxml_gnu_xmmintrin.h" +#endif diff --git a/GCC_XML/Support/GCC/4.3/emmintrin.h b/GCC_XML/Support/GCC/4.3/emmintrin.h new file mode 100644 index 0000000..9744fd6 --- /dev/null +++ b/GCC_XML/Support/GCC/4.3/emmintrin.h @@ -0,0 +1,1043 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2007 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifndef __SSE2__ +# error "SSE2 instruction set not enabled" +#else + +/* We need definitions from the SSE header files*/ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* Create a vector with element 0 as F and the rest zero. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_sd (double __F) +; + +/* Create a vector with both elements equal to F. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pd (double __F) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pd1 (double __F) +; + +/* Create a vector with the lower value X and upper value W. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pd (double __W, double __X) +; + +/* Create a vector with the lower value W and upper value X. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pd (double __W, double __X) +; + +/* Create a vector of zeros. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_pd (void) +; + +/* Sets the low DPFP value of A from the low value of B. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_sd (__m128d __A, __m128d __B) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_pd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load1_pd (double const *__P) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_sd (double const *__P) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadr_pd (double const *__P) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Stores the lower DPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_sd (double *__P, __m128d __A) +; + +extern __inline double __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_f64 (__m128d __A) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_pd (double *__P, __m128d __A) +; + +/* Stores the upper DPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeh_pd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store1_pd (double *__P, __m128d __A) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storer_pd (double *__P, __m128d __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si64 (__m128i __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comile_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comige_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector of Qi, where i is the element number. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi64x (long long __q1, long long __q0) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi64 (__m64 __q1, __m64 __q0) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +; + +/* Set all of the elements of the vector to A. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi64x (long long __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi64 (__m64 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi32 (int __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi16 (short __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi8 (char __A) +; + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_si128 (__m128i const *__P) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_si128 (__m128i const *__P) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_epi64 (__m128i const *__P) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movepi64_pi64 (__m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movpi64_epi64 (__m64 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_epi64 (__m128i __A) +; + +/* Create a vector of zeros. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_si128 (void) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtepi32_pd (__m128i __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtepi32_ps (__m128i __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_epi32 (__m128d __A) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_pi32 (__m128d __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_ps (__m128d __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttpd_epi32 (__m128d __A) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttpd_pi32 (__m128d __A) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32_pd (__m64 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_epi32 (__m128 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttps_epi32 (__m128 __A) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pd (__m128 __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_sd (__m128d __A, long long __B) +; + +/* Microsoft intrinsic. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +#ifdef __OPTIMIZE__ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_pd(__m128d __A, __m128d __B, const int __mask) +; +#else +#define _mm_shuffle_pd(A, B, N) \ + ((__m128d)__builtin_ia32_shufpd ((__v2df)(__m128d)(A), \ + (__v2df)(__m128d)(B), (int)(N))) +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadh_pd (__m128d __A, double const *__B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_pd (__m128d __A, double const *__B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_pd (__m128d __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi16 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi32 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi64 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_epi16 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_epi32 (__m128i __A, int __B) +; + +#ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_si128 (__m128i __A, const int __N) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_si128 (__m128i __A, const int __N) +; +#else +#define _mm_srli_si128(A, N) \ + ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8)) +#define _mm_slli_si128(A, N) \ + ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8)) +#endif + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi16 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi32 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi64 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_si128 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_si128 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#ifdef __OPTIMIZE__ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +; +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(__m128i)(A), \ + (int)(D), (int)(N))) +#endif + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_epi8 (__m128i __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +#ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shufflehi_epi16 (__m128i __A, const int __mask) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shufflelo_epi16 (__m128i __A, const int __mask) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_epi32 (__m128i __A, const int __mask) +; +#else +#define _mm_shufflehi_epi16(A, N) \ + ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_shufflelo_epi16(A, N) \ + ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_shuffle_epi32(A, N) \ + ((__m128i)__builtin_ia32_pshufd ((__v4si)(__m128i)(A), (int)(N))) +#endif + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_si32 (int *__A, int __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_pd (double *__A, __m128d __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_clflush (void const *__A) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_lfence (void) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mfence (void) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si128 (long long __A) +; + +/* Microsoft intrinsic. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castpd_ps(__m128d __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castpd_si128(__m128d __A) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castps_pd(__m128 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castps_si128(__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castsi128_ps(__m128i __A) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castsi128_pd(__m128i __A) +; + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.3/gccxml_builtins.h b/GCC_XML/Support/GCC/4.3/gccxml_builtins.h index aaef13e..200ee51 100644 --- a/GCC_XML/Support/GCC/4.3/gccxml_builtins.h +++ b/GCC_XML/Support/GCC/4.3/gccxml_builtins.h @@ -143,6 +143,7 @@ bool __builtin_islessequal(...); bool __builtin_islessgreater(...); bool __builtin_isunordered(...); bool __builtin_va_arg_pack(...); +int __builtin_va_arg_pack_len(...); /* @@ -180,3 +181,8 @@ library. #define __is_pod(x) false #define __is_empty(x) false #define __has_trivial_destructor(x) false + +#ifdef __llvm__ +extern unsigned int __builtin_bswap32(unsigned int _data); +extern unsigned long __builtin_bswap64(unsigned long _data); +#endif diff --git a/GCC_XML/Support/GCC/4.3/mmintrin.h b/GCC_XML/Support/GCC/4.3/mmintrin.h new file mode 100644 index 0000000..2581a2b --- /dev/null +++ b/GCC_XML/Support/GCC/4.3/mmintrin.h @@ -0,0 +1,663 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); + +/* Empty the multimedia state. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_empty (void) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_si64 (int __i) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ + +/* Intel intrinsic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_from_int64 (long long __i) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_m64 (long long __i) +; + +/* Microsoft intrinsic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_si64 (long long __i) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si32 (__m64 __i) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_to_int64 (__m64 __i) +; + +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtm64_si64 (__m64 __i) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllw (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_pi16 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pslld (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_pi32 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllq (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_si64 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psraw (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_pi16 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrad (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_pi32 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlw (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_pi16 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrld (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_pi32 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlq (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_si64 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi32 (int __i0, int __i1) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi8 (char __b) +; + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.3/xmmintrin.h b/GCC_XML/Support/GCC/4.3/xmmintrin.h new file mode 100644 index 0000000..388f78c --- /dev/null +++ b/GCC_XML/Support/GCC/4.3/xmmintrin.h @@ -0,0 +1,867 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 + 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 2, 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. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, if you include this header file into source + files compiled by GCC, this header file does not by itself cause + the resulting executable to be covered by the GNU General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU General + Public License. */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* Create a vector of zeros. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_ps (void) +; + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_ss (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rcp_ss (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rsqrt_ss (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_ps (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rcp_ps (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rsqrt_ps (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comile_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comige_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si32 (__m128 __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi32 (__m128 __A) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si32 (__m128 __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttps_pi32 (__m128 __A) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ + +/* Intel intrinsic. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_ss (__m128 __A, long long __B) +; + +/* Microsoft intrinsic. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#ifdef __OPTIMIZE__ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_ps (__m128 __A, __m128 __B, int const __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), (int)(MASK))) +#endif + +/* Selects and interleaves the upper two SPFP values from A and B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_EXCEPTION_STATE (void) +; + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_EXCEPTION_MASK (void) +; + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_ROUNDING_MODE (void) +; + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as F and the rest zero. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_ps (float __F) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ps1 (float __F) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load1_ps (float const *__P) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadr_ps (float const *__P) +; + +/* Create the vector [Z Y X W]. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Stores the lower SPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ss (float *__P, __m128 __A) +; + +extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_f32 (__m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store1_ps (float *__P, __m128 __A) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#ifdef __OPTIMIZE__ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_pi16 (__m64 const __A, int const __N) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pextrw (__m64 const __A, int const __N) +; +#else +#define _mm_extract_pi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v4hi ((__v4hi)(__m64)(A), (int)(N))) + +#define _m_pextrw(A, N) _mm_extract_pi16(A, N) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#ifdef __OPTIMIZE__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(__m64)(A), \ + (int)(D), (int)(N))) + +#define _m_pinsrw(A, D, N) _mm_insert_pi16(A, D, N) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_pi8 (__m64 __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#ifdef __OPTIMIZE__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_pi16 (__m64 __A, int const __N) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pshufw (__m64 __A, int const __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N))) + +#define _m_pshufw(A, N) _mm_shuffle_pi16 (A, N) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#ifdef __OPTIMIZE__ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_prefetch (const void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_pause (void) +; + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ +} while (0) + +/* For backward source compatibility. */ +#ifdef __SSE2__ +# include +#endif + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.4/emmintrin.h b/GCC_XML/Support/GCC/4.4/emmintrin.h new file mode 100644 index 0000000..d2a55dd --- /dev/null +++ b/GCC_XML/Support/GCC/4.4/emmintrin.h @@ -0,0 +1,1041 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifndef __SSE2__ +# error "SSE2 instruction set not enabled" +#else + +/* We need definitions from the SSE header files*/ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* Create a vector with element 0 as F and the rest zero. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_sd (double __F) +; + +/* Create a vector with both elements equal to F. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pd (double __F) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pd1 (double __F) +; + +/* Create a vector with the lower value X and upper value W. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pd (double __W, double __X) +; + +/* Create a vector with the lower value W and upper value X. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pd (double __W, double __X) +; + +/* Create a vector of zeros. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_pd (void) +; + +/* Sets the low DPFP value of A from the low value of B. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_sd (__m128d __A, __m128d __B) +; + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_pd (double const *__P) +; + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_pd (double const *__P) +; + +/* Create a vector with all two elements equal to *P. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load1_pd (double const *__P) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_sd (double const *__P) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_pd1 (double const *__P) +; + +/* Load two DPFP values in reverse order. The address must be aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadr_pd (double const *__P) +; + +/* Store two DPFP values. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_pd (double *__P, __m128d __A) +; + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_pd (double *__P, __m128d __A) +; + +/* Stores the lower DPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_sd (double *__P, __m128d __A) +; + +extern __inline double __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_f64 (__m128d __A) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_pd (double *__P, __m128d __A) +; + +/* Stores the upper DPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeh_pd (double *__P, __m128d __A) +; + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store1_pd (double *__P, __m128d __A) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_pd1 (double *__P, __m128d __A) +; + +/* Store two DPFP values in reverse order. The address must be aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storer_pd (double *__P, __m128d __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si32 (__m128i __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si64 (__m128i __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si64x (__m128i __A) +; +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_pd (__m128d __A) +; + +/* Return pair {sqrt (A[0), B[1]}. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_sd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comieq_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comilt_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comile_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comigt_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comige_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comineq_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomieq_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomilt_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomile_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomigt_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomige_sd (__m128d __A, __m128d __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomineq_sd (__m128d __A, __m128d __B) +; + +/* Create a vector of Qi, where i is the element number. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi64x (long long __q1, long long __q0) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi64 (__m64 __q1, __m64 __q0) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +; + +/* Set all of the elements of the vector to A. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi64x (long long __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi64 (__m64 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi32 (int __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi16 (short __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi8 (char __A) +; + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +; + +/* Create a vector with element 0 as *P and the rest zero. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_si128 (__m128i const *__P) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_si128 (__m128i const *__P) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_epi64 (__m128i const *__P) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_si128 (__m128i *__P, __m128i __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_si128 (__m128i *__P, __m128i __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_epi64 (__m128i *__P, __m128i __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movepi64_pi64 (__m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movpi64_epi64 (__m64 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_epi64 (__m128i __A) +; + +/* Create a vector of zeros. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_si128 (void) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtepi32_pd (__m128i __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtepi32_ps (__m128i __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_epi32 (__m128d __A) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_pi32 (__m128d __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_ps (__m128d __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttpd_epi32 (__m128d __A) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttpd_pi32 (__m128d __A) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32_pd (__m64 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_epi32 (__m128 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttps_epi32 (__m128 __A) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pd (__m128 __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si64x (__m128d __A) +; +#endif + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si32 (__m128d __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si64 (__m128d __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si64x (__m128d __A) +; +#endif + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_ss (__m128 __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_sd (__m128d __A, int __B) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_sd (__m128d __A, long long __B) +; + +/* Microsoft intrinsic. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_sd (__m128d __A, long long __B) +; +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_sd (__m128d __A, __m128 __B) +; + +#ifdef __OPTIMIZE__ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_pd(__m128d __A, __m128d __B, const int __mask) +; +#else +#define _mm_shuffle_pd(A, B, N) \ + ((__m128d)__builtin_ia32_shufpd ((__v2df)(__m128d)(A), \ + (__v2df)(__m128d)(B), (int)(N))) +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pd (__m128d __A, __m128d __B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadh_pd (__m128d __A, double const *__B) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_pd (__m128d __A, double const *__B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_pd (__m128d __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packus_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epu8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epu16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epu8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epu16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_madd_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mullo_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_su32 (__m64 __A, __m64 __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_epu32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi16 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi32 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi64 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_epi16 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_epi32 (__m128i __A, int __B) +; + +#ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_si128 (__m128i __A, const int __N) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_si128 (__m128i __A, const int __N) +; +#else +#define _mm_srli_si128(A, N) \ + ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8)) +#define _mm_slli_si128(A, N) \ + ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8)) +#endif + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi16 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi32 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi64 (__m128i __A, int __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi64 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_si128 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_si128 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_si128 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_si128 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +; + +#ifdef __OPTIMIZE__ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +; +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(__m128i)(A), \ + (int)(D), (int)(N))) +#endif + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_epu8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_epi16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_epu8 (__m128i __A, __m128i __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_epi8 (__m128i __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +; + +#ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shufflehi_epi16 (__m128i __A, const int __mask) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shufflelo_epi16 (__m128i __A, const int __mask) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_epi32 (__m128i __A, const int __mask) +; +#else +#define _mm_shufflehi_epi16(A, N) \ + ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_shufflelo_epi16(A, N) \ + ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_shuffle_epi32(A, N) \ + ((__m128i)__builtin_ia32_pshufd ((__v4si)(__m128i)(A), (int)(N))) +#endif + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_epu8 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_epu16 (__m128i __A, __m128i __B) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sad_epu8 (__m128i __A, __m128i __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_si32 (int *__A, int __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_si128 (__m128i *__A, __m128i __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_pd (double *__A, __m128d __B) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_clflush (void const *__A) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_lfence (void) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mfence (void) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_si128 (int __A) +; + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si128 (long long __A) +; + +/* Microsoft intrinsic. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_si128 (long long __A) +; +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castpd_ps(__m128d __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castpd_si128(__m128d __A) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castps_pd(__m128 __A) +; + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castps_si128(__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castsi128_ps(__m128i __A) +; + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castsi128_pd(__m128i __A) +; + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.4/gccxml_builtins.h b/GCC_XML/Support/GCC/4.4/gccxml_builtins.h index 9167fde..ec27967 100644 --- a/GCC_XML/Support/GCC/4.4/gccxml_builtins.h +++ b/GCC_XML/Support/GCC/4.4/gccxml_builtins.h @@ -145,8 +145,14 @@ bool __builtin_isnan(...); bool __builtin_isnormal(...); bool __builtin_isunordered(...); bool __builtin_va_arg_pack(...); +int __builtin_va_arg_pack_len(...); /* We fake some constant expressions from GCC 4.4 parser. */ #define __is_pod(x) false #define __is_empty(x) false #define __has_trivial_destructor(x) false + +#ifdef __llvm__ +extern unsigned int __builtin_bswap32(unsigned int _data); +extern unsigned long __builtin_bswap64(unsigned long _data); +#endif diff --git a/GCC_XML/Support/GCC/4.4/mmintrin.h b/GCC_XML/Support/GCC/4.4/mmintrin.h new file mode 100644 index 0000000..99c2680 --- /dev/null +++ b/GCC_XML/Support/GCC/4.4/mmintrin.h @@ -0,0 +1,662 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); +typedef long long __v1di __attribute__ ((__vector_size__ (8))); +typedef float __v2sf __attribute__ ((__vector_size__ (8))); + +/* Empty the multimedia state. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_empty (void) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_empty (void) +; + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_si64 (int __i) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_from_int (int __i) +; + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ + +/* Intel intrinsic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_from_int64 (long long __i) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_m64 (long long __i) +; + +/* Microsoft intrinsic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_si64 (long long __i) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi64x (long long __i) +; +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si32 (__m64 __i) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_to_int (__m64 __i) +; + +#ifdef __x86_64__ +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_to_int64 (__m64 __i) +; + +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtm64_si64 (__m64 __i) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si64x (__m64 __i) +; +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packsswb (__m64 __m1, __m64 __m2) +; + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packssdw (__m64 __m1, __m64 __m2) +; + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packuswb (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhdq (__m64 __m1, __m64 __m2) +; + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpcklbw (__m64 __m1, __m64 __m2) +; + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpcklwd (__m64 __m1, __m64 __m2) +; + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckldq (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddw (__m64 __m1, __m64 __m2) +; + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddsb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddsw (__m64 __m1, __m64 __m2) +; + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddusb (__m64 __m1, __m64 __m2) +; + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddusw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubd (__m64 __m1, __m64 __m2) +; + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; +#endif + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubsb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubsw (__m64 __m1, __m64 __m2) +; + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubusb (__m64 __m1, __m64 __m2) +; + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubusw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaddwd (__m64 __m1, __m64 __m2) +; + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmulhw (__m64 __m1, __m64 __m2) +; + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmullw (__m64 __m1, __m64 __m2) +; + +/* Shift four 16-bit values in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_pi16 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllw (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_pi16 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_pi32 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pslld (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_pi32 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pslldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_si64 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllq (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_si64 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllqi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_pi16 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psraw (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_pi16 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrawi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_pi32 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrad (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_pi32 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psradi (__m64 __m, int __count) +; + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_pi16 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlw (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_pi16 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlwi (__m64 __m, int __count) +; + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_pi32 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrld (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_pi32 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrldi (__m64 __m, int __count) +; + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_si64 (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlq (__m64 __m, __m64 __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_si64 (__m64 __m, int __count) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlqi (__m64 __m, int __count) +; + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_si64 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pand (__m64 __m1, __m64 __m2) +; + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pandn (__m64 __m1, __m64 __m2) +; + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_si64 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_por (__m64 __m1, __m64 __m2) +; + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_si64 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pxor (__m64 __m1, __m64 __m2) +; + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqb (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtb (__m64 __m1, __m64 __m2) +; + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqw (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtw (__m64 __m1, __m64 __m2) +; + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqd (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtd (__m64 __m1, __m64 __m2) +; + +/* Creates a 64-bit zero. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_si64 (void) +; + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi32 (int __i1, int __i0) +; + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +; + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, + char __b3, char __b2, char __b1, char __b0) +; + +/* Similar, but with the arguments in reverse order. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi32 (int __i0, int __i1) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, + char __b4, char __b5, char __b6, char __b7) +; + +/* Creates a vector of two 32-bit values, both elements containing I. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi32 (int __i) +; + +/* Creates a vector of four 16-bit values, all elements containing W. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi16 (short __w) +; + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi8 (char __b) +; + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.4/xmmintrin.h b/GCC_XML/Support/GCC/4.4/xmmintrin.h new file mode 100644 index 0000000..a5d8e8d --- /dev/null +++ b/GCC_XML/Support/GCC/4.4/xmmintrin.h @@ -0,0 +1,864 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* Create a vector of zeros. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_ps (void) +; + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_ss (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rcp_ss (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rsqrt_ss (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_ss (__m128 __A, __m128 __B) +; + +/* Perform the respective operation on the four SPFP values in A and B. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_ps (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rcp_ps (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rsqrt_ps (__m128 __A) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_ps (__m128 __A, __m128 __B) +; + +/* Perform logical bit-wise operations on 128-bit values. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_ps (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_ss (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_ss (__m128 __A, __m128 __B) +; + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_ps (__m128 __A, __m128 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_ps (__m128 __A, __m128 __B) +; + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comieq_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comilt_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comile_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comigt_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comige_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comineq_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomieq_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomilt_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomile_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomigt_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomige_ss (__m128 __A, __m128 __B) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomineq_ss (__m128 __A, __m128 __B) +; + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si32 (__m128 __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si64x (__m128 __A) +; +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi32 (__m128 __A) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_ps2pi (__m128 __A) +; + +/* Truncate the lower SPFP value to a 32-bit integer. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si32 (__m128 __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtt_ss2si (__m128 __A) +; + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si64 (__m128 __A) +; + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si64x (__m128 __A) +; +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttps_pi32 (__m128 __A) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtt_ps2pi (__m128 __A) +; + +/* Convert B to a SPFP value and insert it as element zero in A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_ss (__m128 __A, int __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_si2ss (__m128 __A, int __B) +; + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ + +/* Intel intrinsic. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_ss (__m128 __A, long long __B) +; + +/* Microsoft intrinsic. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_ss (__m128 __A, long long __B) +; +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +; + +/* Convert the four signed 16-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi16_ps (__m64 __A) +; + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpu16_ps (__m64 __A) +; + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi8_ps (__m64 __A) +; + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpu8_ps(__m64 __A) +; + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +; + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi16(__m128 __A) +; + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi8(__m128 __A) +; + +/* Selects four specific SPFP values from A and B based on MASK. */ +#ifdef __OPTIMIZE__ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_ps (__m128 __A, __m128 __B, int const __mask) +; +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), (int)(MASK))) +#endif + +/* Selects and interleaves the upper two SPFP values from A and B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_ps (__m128 __A, __m128 __B) +; + +/* Selects and interleaves the lower two SPFP values from A and B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_ps (__m128 __A, __m128 __B) +; + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the upper two SPFP values of A into P. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeh_pi (__m64 *__P, __m128 __A) +; + +/* Moves the upper two values of B into the lower two values of A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movehl_ps (__m128 __A, __m128 __B) +; + +/* Moves the lower two values of B into the upper two values of A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movelh_ps (__m128 __A, __m128 __B) +; + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; + +/* Stores the lower two SPFP values of A into P. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_pi (__m64 *__P, __m128 __A) +; + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_ps (__m128 __A) +; + +/* Return the contents of the control register. */ +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_getcsr (void) +; + +/* Read exception bits from the control register. */ +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_EXCEPTION_STATE (void) +; + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_EXCEPTION_MASK (void) +; + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_ROUNDING_MODE (void) +; + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_FLUSH_ZERO_MODE (void) +; + +/* Set the control register to I. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setcsr (unsigned int __I) +; + +/* Set exception bits in the control register. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_ROUNDING_MODE (unsigned int __mode) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +; + +/* Create a vector with element 0 as F and the rest zero. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ss (float __F) +; + +/* Create a vector with all four elements equal to F. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_ps (float __F) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ps1 (float __F) +; + +/* Create a vector with element 0 as *P and the rest zero. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ss (float const *__P) +; + +/* Create a vector with all four elements equal to *P. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load1_ps (float const *__P) +; + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ps1 (float const *__P) +; + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ps (float const *__P) +; + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_ps (float const *__P) +; + +/* Load four SPFP values in reverse order. The address must be aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadr_ps (float const *__P) +; + +/* Create the vector [Z Y X W]. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +; + +/* Create the vector [W X Y Z]. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +; + +/* Stores the lower SPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ss (float *__P, __m128 __A) +; + +extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_f32 (__m128 __A) +; + +/* Store four SPFP values. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ps (float *__P, __m128 __A) +; + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_ps (float *__P, __m128 __A) +; + +/* Store the lower SPFP value across four words. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store1_ps (float *__P, __m128 __A) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ps1 (float *__P, __m128 __A) +; + +/* Store four SPFP values in reverse order. The address must be aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storer_ps (float *__P, __m128 __A) +; + +/* Sets the low SPFP value of A from the low value of B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_ss (__m128 __A, __m128 __B) +; + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#ifdef __OPTIMIZE__ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_pi16 (__m64 const __A, int const __N) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pextrw (__m64 const __A, int const __N) +; +#else +#define _mm_extract_pi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v4hi ((__v4hi)(__m64)(A), (int)(N))) + +#define _m_pextrw(A, N) _mm_extract_pi16(A, N) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#ifdef __OPTIMIZE__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) +; +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(__m64)(A), \ + (int)(D), (int)(N))) + +#define _m_pinsrw(A, D, N) _mm_insert_pi16(A, D, N) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pi16 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaxsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pu8 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaxub (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of signed 16-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pi16 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pminsw (__m64 __A, __m64 __B) +; + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pu8 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pminub (__m64 __A, __m64 __B) +; + +/* Create an 8-bit mask of the signs of 8-bit values. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_pi8 (__m64 __A) +; + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmovmskb (__m64 __A) +; + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmulhuw (__m64 __A, __m64 __B) +; + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#ifdef __OPTIMIZE__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_pi16 (__m64 __A, int const __N) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pshufw (__m64 __A, int const __N) +; +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N))) + +#define _m_pshufw(A, N) _mm_shuffle_pi16 (A, N) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +; + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +; + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_pu8 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pavgb (__m64 __A, __m64 __B) +; + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_pu16 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pavgw (__m64 __A, __m64 __B) +; + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sad_pu8 (__m64 __A, __m64 __B) +; + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psadbw (__m64 __A, __m64 __B) +; + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#ifdef __OPTIMIZE__ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_prefetch (const void *__P, enum _mm_hint __I) +; +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_pi (__m64 *__P, __m64 __A) +; + +/* Likewise. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_ps (float *__P, __m128 __A) +; + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sfence (void) +; + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_pause (void) +; + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ +} while (0) + +/* For backward source compatibility. */ +#ifdef __SSE2__ +# include +#endif + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.5/emmintrin.h b/GCC_XML/Support/GCC/4.5/emmintrin.h new file mode 100644 index 0000000..a886baa --- /dev/null +++ b/GCC_XML/Support/GCC/4.5/emmintrin.h @@ -0,0 +1,1513 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifndef __SSE2__ +# error "SSE2 instruction set not enabled" +#else + +/* We need definitions from the SSE header files*/ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* Create a vector with element 0 as F and the rest zero. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_sd (double __F) +{ + return __extension__ (__m128d){ __F, 0.0 }; +} + +/* Create a vector with both elements equal to F. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pd (double __F) +{ + return __extension__ (__m128d){ __F, __F }; +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pd1 (double __F) +{ + return _mm_set1_pd (__F); +} + +/* Create a vector with the lower value X and upper value W. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pd (double __W, double __X) +{ + return __extension__ (__m128d){ __X, __W }; +} + +/* Create a vector with the lower value W and upper value X. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pd (double __W, double __X) +{ + return __extension__ (__m128d){ __W, __X }; +} + +/* Create a vector of zeros. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_pd (void) +{ + return __extension__ (__m128d){ 0.0, 0.0 }; +} + +/* Sets the low DPFP value of A from the low value of B. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); +} + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_pd (double const *__P) +{ + return *(__m128d *)__P; +} + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_pd (double const *__P) +{ + return __builtin_ia32_loadupd (__P); +} + +/* Create a vector with all two elements equal to *P. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load1_pd (double const *__P) +{ + return _mm_set1_pd (*__P); +} + +/* Create a vector with element 0 as *P and the rest zero. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_sd (double const *__P) +{ + return _mm_set_sd (*__P); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_pd1 (double const *__P) +{ + return _mm_load1_pd (__P); +} + +/* Load two DPFP values in reverse order. The address must be aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadr_pd (double const *__P) +{ + __m128d __tmp = _mm_load_pd (__P); + return __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1)); +} + +/* Store two DPFP values. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_pd (double *__P, __m128d __A) +{ + *(__m128d *)__P = __A; +} + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_pd (double *__P, __m128d __A) +{ + __builtin_ia32_storeupd (__P, __A); +} + +/* Stores the lower DPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_sd (double *__P, __m128d __A) +{ + *__P = __builtin_ia32_vec_ext_v2df (__A, 0); +} + +extern __inline double __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_f64 (__m128d __A) +{ + return __builtin_ia32_vec_ext_v2df (__A, 0); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_pd (double *__P, __m128d __A) +{ + _mm_store_sd (__P, __A); +} + +/* Stores the upper DPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeh_pd (double *__P, __m128d __A) +{ + *__P = __builtin_ia32_vec_ext_v2df (__A, 1); +} + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store1_pd (double *__P, __m128d __A) +{ + _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,0))); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_pd1 (double *__P, __m128d __A) +{ + _mm_store1_pd (__P, __A); +} + +/* Store two DPFP values in reverse order. The address must be aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storer_pd (double *__P, __m128d __A) +{ + _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,1))); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si32 (__m128i __A) +{ + return __builtin_ia32_vec_ext_v4si ((__v4si)__A, 0); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si64 (__m128i __A) +{ + return __builtin_ia32_vec_ext_v2di ((__v2di)__A, 0); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si64x (__m128i __A) +{ + return __builtin_ia32_vec_ext_v2di ((__v2di)__A, 0); +} +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_addpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_subpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_mulpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_divpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_pd (__m128d __A) +{ + return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A); +} + +/* Return pair {sqrt (A[0), B[1]}. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_sd (__m128d __A, __m128d __B) +{ + __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); + return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df) __A, + (__v2df) + __builtin_ia32_cmpltsd ((__v2df) __B, + (__v2df) + __A)); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df) __A, + (__v2df) + __builtin_ia32_cmplesd ((__v2df) __B, + (__v2df) + __A)); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df) __A, + (__v2df) + __builtin_ia32_cmpnltsd ((__v2df) __B, + (__v2df) + __A)); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df) __A, + (__v2df) + __builtin_ia32_cmpnlesd ((__v2df) __B, + (__v2df) + __A)); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comieq_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comilt_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comile_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comigt_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comige_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comineq_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomieq_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomilt_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomile_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomigt_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomige_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomineq_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B); +} + +/* Create a vector of Qi, where i is the element number. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi64x (long long __q1, long long __q0) +{ + return __extension__ (__m128i)(__v2di){ __q0, __q1 }; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi64 (__m64 __q1, __m64 __q0) +{ + return _mm_set_epi64x ((long long)__q1, (long long)__q0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +{ + return __extension__ (__m128i)(__v4si){ __q0, __q1, __q2, __q3 }; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +{ + return __extension__ (__m128i)(__v8hi){ + __q0, __q1, __q2, __q3, __q4, __q5, __q6, __q7 }; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +{ + return __extension__ (__m128i)(__v16qi){ + __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, + __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15 + }; +} + +/* Set all of the elements of the vector to A. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi64x (long long __A) +{ + return _mm_set_epi64x (__A, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi64 (__m64 __A) +{ + return _mm_set_epi64 (__A, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi32 (int __A) +{ + return _mm_set_epi32 (__A, __A, __A, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi16 (short __A) +{ + return _mm_set_epi16 (__A, __A, __A, __A, __A, __A, __A, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi8 (char __A) +{ + return _mm_set_epi8 (__A, __A, __A, __A, __A, __A, __A, __A, + __A, __A, __A, __A, __A, __A, __A, __A); +} + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +{ + return _mm_set_epi64 (__q1, __q0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +{ + return _mm_set_epi32 (__q3, __q2, __q1, __q0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +{ + return _mm_set_epi16 (__q7, __q6, __q5, __q4, __q3, __q2, __q1, __q0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +{ + return _mm_set_epi8 (__q15, __q14, __q13, __q12, __q11, __q10, __q09, __q08, + __q07, __q06, __q05, __q04, __q03, __q02, __q01, __q00); +} + +/* Create a vector with element 0 as *P and the rest zero. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_si128 (__m128i const *__P) +{ + return *__P; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_si128 (__m128i const *__P) +{ + return (__m128i) __builtin_ia32_loaddqu ((char const *)__P); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_epi64 (__m128i const *__P) +{ + return _mm_set_epi64 ((__m64)0LL, *(__m64 *)__P); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_si128 (__m128i *__P, __m128i __B) +{ + *__P = __B; +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_si128 (__m128i *__P, __m128i __B) +{ + __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_epi64 (__m128i *__P, __m128i __B) +{ + *(long long *)__P = __builtin_ia32_vec_ext_v2di ((__v2di)__B, 0); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movepi64_pi64 (__m128i __B) +{ + return (__m64) __builtin_ia32_vec_ext_v2di ((__v2di)__B, 0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movpi64_epi64 (__m64 __A) +{ + return _mm_set_epi64 ((__m64)0LL, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_epi64 (__m128i __A) +; /* fixme_delete { + return (__m128i)__builtin_ia32_movq128 ((__v2di) __A); +} */ + +/* Create a vector of zeros. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_si128 (void) +{ + return __extension__ (__m128i)(__v4si){ 0, 0, 0, 0 }; +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtepi32_pd (__m128i __A) +{ + return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtepi32_ps (__m128i __A) +{ + return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_epi32 (__m128d __A) +{ + return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_pi32 (__m128d __A) +{ + return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_ps (__m128d __A) +{ + return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttpd_epi32 (__m128d __A) +{ + return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttpd_pi32 (__m128d __A) +{ + return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32_pd (__m64 __A) +{ + return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_epi32 (__m128 __A) +{ + return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttps_epi32 (__m128 __A) +{ + return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pd (__m128 __A) +{ + return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si32 (__m128d __A) +{ + return __builtin_ia32_cvtsd2si ((__v2df) __A); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si64 (__m128d __A) +{ + return __builtin_ia32_cvtsd2si64 ((__v2df) __A); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si64x (__m128d __A) +{ + return __builtin_ia32_cvtsd2si64 ((__v2df) __A); +} +#endif + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si32 (__m128d __A) +{ + return __builtin_ia32_cvttsd2si ((__v2df) __A); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si64 (__m128d __A) +{ + return __builtin_ia32_cvttsd2si64 ((__v2df) __A); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si64x (__m128d __A) +{ + return __builtin_ia32_cvttsd2si64 ((__v2df) __A); +} +#endif + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_ss (__m128 __A, __m128d __B) +{ + return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_sd (__m128d __A, int __B) +{ + return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_sd (__m128d __A, long long __B) +{ + return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); +} + +/* Microsoft intrinsic. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_sd (__m128d __A, long long __B) +{ + return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); +} +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_sd (__m128d __A, __m128 __B) +{ + return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B); +} + +#ifdef __OPTIMIZE__ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_pd(__m128d __A, __m128d __B, const int __mask) +{ + return (__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, __mask); +} +#else +#define _mm_shuffle_pd(A, B, N) \ + ((__m128d)__builtin_ia32_shufpd ((__v2df)(__m128d)(A), \ + (__v2df)(__m128d)(B), (int)(N))) +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadh_pd (__m128d __A, double const *__B) +{ + return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, __B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_pd (__m128d __A, double const *__B) +{ + return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, __B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_pd (__m128d __A) +{ + return __builtin_ia32_movmskpd ((__v2df)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packus_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddd128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epu16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubd128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epu16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_madd_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mullo_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmullw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_su32 (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_epu32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi16 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi32 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi64 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_epi16 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_epi32 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B); +} + +#ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_si128 (__m128i __A, const int __N) +{ + return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_si128 (__m128i __A, const int __N) +{ + return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8); +} +#else +#define _mm_srli_si128(A, N) \ + ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8)) +#define _mm_slli_si128(A, N) \ + ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8)) +#endif + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi16 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi32 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi64 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psllw128((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pslld128((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psllq128((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pand128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_por128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pxor128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpeqb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpeqw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpeqd128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__B, (__v16qi)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__B, (__v8hi)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__B, (__v4si)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__A, (__v4si)__B); +} + +#ifdef __OPTIMIZE__ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +{ + return __builtin_ia32_vec_ext_v8hi ((__v8hi)__A, __N); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +{ + return (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)__A, __D, __N); +} +#else +#define _mm_extract_epi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(__m128i)(A), \ + (int)(D), (int)(N))) +#endif + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_epi8 (__m128i __A) +{ + return __builtin_ia32_pmovmskb128 ((__v16qi)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B); +} + +#ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shufflehi_epi16 (__m128i __A, const int __mask) +{ + return (__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __mask); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shufflelo_epi16 (__m128i __A, const int __mask) +{ + return (__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __mask); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_epi32 (__m128i __A, const int __mask) +{ + return (__m128i)__builtin_ia32_pshufd ((__v4si)__A, __mask); +} +#else +#define _mm_shufflehi_epi16(A, N) \ + ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_shufflelo_epi16(A, N) \ + ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_shuffle_epi32(A, N) \ + ((__m128i)__builtin_ia32_pshufd ((__v4si)(__m128i)(A), (int)(N))) +#endif + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +{ + __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_epu16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sad_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_si32 (int *__A, int __B) +{ + __builtin_ia32_movnti (__A, __B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_si128 (__m128i *__A, __m128i __B) +{ + __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_pd (double *__A, __m128d __B) +{ + __builtin_ia32_movntpd (__A, (__v2df)__B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_clflush (void const *__A) +{ + __builtin_ia32_clflush (__A); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_lfence (void) +{ + __builtin_ia32_lfence (); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mfence (void) +{ + __builtin_ia32_mfence (); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_si128 (int __A) +{ + return _mm_set_epi32 (0, 0, 0, __A); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si128 (long long __A) +{ + return _mm_set_epi64x (0, __A); +} + +/* Microsoft intrinsic. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_si128 (long long __A) +{ + return _mm_set_epi64x (0, __A); +} +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castpd_ps(__m128d __A) +{ + return (__m128) __A; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castpd_si128(__m128d __A) +{ + return (__m128i) __A; +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castps_pd(__m128 __A) +{ + return (__m128d) __A; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castps_si128(__m128 __A) +{ + return (__m128i) __A; +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castsi128_ps(__m128i __A) +{ + return (__m128) __A; +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castsi128_pd(__m128i __A) +{ + return (__m128d) __A; +} + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.5/gccxml_builtins.h b/GCC_XML/Support/GCC/4.5/gccxml_builtins.h index 20f40af..9a9aa72 100644 --- a/GCC_XML/Support/GCC/4.5/gccxml_builtins.h +++ b/GCC_XML/Support/GCC/4.5/gccxml_builtins.h @@ -145,9 +145,15 @@ bool __builtin_isnan(...); bool __builtin_isnormal(...); bool __builtin_isunordered(...); bool __builtin_va_arg_pack(...); +int __builtin_va_arg_pack_len(...); /* We fake some constant expressions from GCC 4.5 parser. */ #define __is_pod(x) false #define __is_empty(x) false #define __has_trivial_destructor(x) false #define __has_trivial_constructor(x) false + +#ifdef __llvm__ +extern unsigned int __builtin_bswap32(unsigned int _data); +extern unsigned long __builtin_bswap64(unsigned long _data); +#endif diff --git a/GCC_XML/Support/GCC/4.5/mmintrin.h b/GCC_XML/Support/GCC/4.5/mmintrin.h new file mode 100644 index 0000000..b6e72b9 --- /dev/null +++ b/GCC_XML/Support/GCC/4.5/mmintrin.h @@ -0,0 +1,921 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); +typedef long long __v1di __attribute__ ((__vector_size__ (8))); +typedef float __v2sf __attribute__ ((__vector_size__ (8))); + +/* Empty the multimedia state. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_empty (void) +{ + __builtin_ia32_emms (); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_empty (void) +{ + _mm_empty (); +} + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_si64 (int __i) +{ + return (__m64) __builtin_ia32_vec_init_v2si (__i, 0); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_from_int (int __i) +{ + return _mm_cvtsi32_si64 (__i); +} + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ + +/* Intel intrinsic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_from_int64 (long long __i) +{ + return (__m64) __i; +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_m64 (long long __i) +{ + return (__m64) __i; +} + +/* Microsoft intrinsic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_si64 (long long __i) +{ + return (__m64) __i; +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi64x (long long __i) +{ + return (__m64) __i; +} +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si32 (__m64 __i) +{ + return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_to_int (__m64 __i) +{ + return _mm_cvtsi64_si32 (__i); +} + +#ifdef __x86_64__ +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_to_int64 (__m64 __i) +{ + return (long long)__i; +} + +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtm64_si64 (__m64 __i) +{ + return (long long)__i; +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si64x (__m64 __i) +{ + return (long long)__i; +} +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packsswb (__m64 __m1, __m64 __m2) +{ + return _mm_packs_pi16 (__m1, __m2); +} + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packssdw (__m64 __m1, __m64 __m2) +{ + return _mm_packs_pi32 (__m1, __m2); +} + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packuswb (__m64 __m1, __m64 __m2) +{ + return _mm_packs_pu16 (__m1, __m2); +} + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhbw (__m64 __m1, __m64 __m2) +{ + return _mm_unpackhi_pi8 (__m1, __m2); +} + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhwd (__m64 __m1, __m64 __m2) +{ + return _mm_unpackhi_pi16 (__m1, __m2); +} + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhdq (__m64 __m1, __m64 __m2) +{ + return _mm_unpackhi_pi32 (__m1, __m2); +} + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpcklbw (__m64 __m1, __m64 __m2) +{ + return _mm_unpacklo_pi8 (__m1, __m2); +} + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpcklwd (__m64 __m1, __m64 __m2) +{ + return _mm_unpacklo_pi16 (__m1, __m2); +} + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckldq (__m64 __m1, __m64 __m2) +{ + return _mm_unpacklo_pi32 (__m1, __m2); +} + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddb (__m64 __m1, __m64 __m2) +{ + return _mm_add_pi8 (__m1, __m2); +} + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddw (__m64 __m1, __m64 __m2) +{ + return _mm_add_pi16 (__m1, __m2); +} + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddd (__m64 __m1, __m64 __m2) +{ + return _mm_add_pi32 (__m1, __m2); +} + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_si64 (__m64 __m1, __m64 __m2) +; /* fixme_delete { + return (__m64) __builtin_ia32_paddq ((__v1di)__m1, (__v1di)__m2); +} */ +#endif + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddsb (__m64 __m1, __m64 __m2) +{ + return _mm_adds_pi8 (__m1, __m2); +} + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddsw (__m64 __m1, __m64 __m2) +{ + return _mm_adds_pi16 (__m1, __m2); +} + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddusb (__m64 __m1, __m64 __m2) +{ + return _mm_adds_pu8 (__m1, __m2); +} + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddusw (__m64 __m1, __m64 __m2) +{ + return _mm_adds_pu16 (__m1, __m2); +} + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubb (__m64 __m1, __m64 __m2) +{ + return _mm_sub_pi8 (__m1, __m2); +} + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubw (__m64 __m1, __m64 __m2) +{ + return _mm_sub_pi16 (__m1, __m2); +} + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubd (__m64 __m1, __m64 __m2) +{ + return _mm_sub_pi32 (__m1, __m2); +} + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_si64 (__m64 __m1, __m64 __m2) +; /* fixme_delete { + return (__m64) __builtin_ia32_psubq ((__v1di)__m1, (__v1di)__m2); +} */ +#endif + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubsb (__m64 __m1, __m64 __m2) +{ + return _mm_subs_pi8 (__m1, __m2); +} + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubsw (__m64 __m1, __m64 __m2) +{ + return _mm_subs_pi16 (__m1, __m2); +} + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubusb (__m64 __m1, __m64 __m2) +{ + return _mm_subs_pu8 (__m1, __m2); +} + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubusw (__m64 __m1, __m64 __m2) +{ + return _mm_subs_pu16 (__m1, __m2); +} + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaddwd (__m64 __m1, __m64 __m2) +{ + return _mm_madd_pi16 (__m1, __m2); +} + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmulhw (__m64 __m1, __m64 __m2) +{ + return _mm_mulhi_pi16 (__m1, __m2); +} + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmullw (__m64 __m1, __m64 __m2) +{ + return _mm_mullo_pi16 (__m1, __m2); +} + +/* Shift four 16-bit values in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_pi16 (__m64 __m, __m64 __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (__v4hi)__count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllw (__m64 __m, __m64 __count) +{ + return _mm_sll_pi16 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_pi16 (__m64 __m, int __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psllwi ((__v4hi)__m, __count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllwi (__m64 __m, int __count) +{ + return _mm_slli_pi16 (__m, __count); +} + +/* Shift two 32-bit values in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_pi32 (__m64 __m, __m64 __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_pslld ((__v2si)__m, (__v2si)__count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pslld (__m64 __m, __m64 __count) +{ + return _mm_sll_pi32 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_pi32 (__m64 __m, int __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_pslldi ((__v2si)__m, __count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pslldi (__m64 __m, int __count) +{ + return _mm_slli_pi32 (__m, __count); +} + +/* Shift the 64-bit value in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_si64 (__m64 __m, __m64 __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psllq ((__v1di)__m, (__v1di)__count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllq (__m64 __m, __m64 __count) +{ + return _mm_sll_si64 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_si64 (__m64 __m, int __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psllqi ((__v1di)__m, __count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllqi (__m64 __m, int __count) +{ + return _mm_slli_si64 (__m, __count); +} + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_pi16 (__m64 __m, __m64 __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (__v4hi)__count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psraw (__m64 __m, __m64 __count) +{ + return _mm_sra_pi16 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_pi16 (__m64 __m, int __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psrawi ((__v4hi)__m, __count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrawi (__m64 __m, int __count) +{ + return _mm_srai_pi16 (__m, __count); +} + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_pi32 (__m64 __m, __m64 __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psrad ((__v2si)__m, (__v2si)__count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrad (__m64 __m, __m64 __count) +{ + return _mm_sra_pi32 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_pi32 (__m64 __m, int __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psradi ((__v2si)__m, __count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psradi (__m64 __m, int __count) +{ + return _mm_srai_pi32 (__m, __count); +} + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_pi16 (__m64 __m, __m64 __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (__v4hi)__count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlw (__m64 __m, __m64 __count) +{ + return _mm_srl_pi16 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_pi16 (__m64 __m, int __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psrlwi ((__v4hi)__m, __count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlwi (__m64 __m, int __count) +{ + return _mm_srli_pi16 (__m, __count); +} + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_pi32 (__m64 __m, __m64 __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psrld ((__v2si)__m, (__v2si)__count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrld (__m64 __m, __m64 __count) +{ + return _mm_srl_pi32 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_pi32 (__m64 __m, int __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psrldi ((__v2si)__m, __count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrldi (__m64 __m, int __count) +{ + return _mm_srli_pi32 (__m, __count); +} + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_si64 (__m64 __m, __m64 __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psrlq ((__v1di)__m, (__v1di)__count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlq (__m64 __m, __m64 __count) +{ + return _mm_srl_si64 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_si64 (__m64 __m, int __count) +; /* fixme_delete { + return (__m64) __builtin_ia32_psrlqi ((__v1di)__m, __count); +} */ + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlqi (__m64 __m, int __count) +{ + return _mm_srli_si64 (__m, __count); +} + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_si64 (__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pand (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pand (__m64 __m1, __m64 __m2) +{ + return _mm_and_si64 (__m1, __m2); +} + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pandn (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pandn (__m64 __m1, __m64 __m2) +{ + return _mm_andnot_si64 (__m1, __m2); +} + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_si64 (__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_por (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_por (__m64 __m1, __m64 __m2) +{ + return _mm_or_si64 (__m1, __m2); +} + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_si64 (__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pxor (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pxor (__m64 __m1, __m64 __m2) +{ + return _mm_xor_si64 (__m1, __m2); +} + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqb (__m64 __m1, __m64 __m2) +{ + return _mm_cmpeq_pi8 (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtb (__m64 __m1, __m64 __m2) +{ + return _mm_cmpgt_pi8 (__m1, __m2); +} + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqw (__m64 __m1, __m64 __m2) +{ + return _mm_cmpeq_pi16 (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtw (__m64 __m1, __m64 __m2) +{ + return _mm_cmpgt_pi16 (__m1, __m2); +} + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqd (__m64 __m1, __m64 __m2) +{ + return _mm_cmpeq_pi32 (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtd (__m64 __m1, __m64 __m2) +{ + return _mm_cmpgt_pi32 (__m1, __m2); +} + +/* Creates a 64-bit zero. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_si64 (void) +{ + return (__m64)0LL; +} + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi32 (int __i1, int __i0) +{ + return (__m64) __builtin_ia32_vec_init_v2si (__i0, __i1); +} + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +{ + return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3); +} + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_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); +} + +/* Similar, but with the arguments in reverse order. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi32 (int __i0, int __i1) +{ + return _mm_set_pi32 (__i1, __i0); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +{ + return _mm_set_pi16 (__w3, __w2, __w1, __w0); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_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); +} + +/* Creates a vector of two 32-bit values, both elements containing I. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi32 (int __i) +{ + return _mm_set_pi32 (__i, __i); +} + +/* Creates a vector of four 16-bit values, all elements containing W. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi16 (short __w) +{ + return _mm_set_pi16 (__w, __w, __w, __w); +} + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi8 (char __b) +{ + return _mm_set_pi8 (__b, __b, __b, __b, __b, __b, __b, __b); +} + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.5/xmmintrin.h b/GCC_XML/Support/GCC/4.5/xmmintrin.h new file mode 100644 index 0000000..cb87c9d --- /dev/null +++ b/GCC_XML/Support/GCC/4.5/xmmintrin.h @@ -0,0 +1,1251 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* Create a vector of zeros. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_ps (void) +{ + return __extension__ (__m128){ 0.0f, 0.0f, 0.0f, 0.0f }; +} + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_ss (__m128 __A) +{ + return (__m128) __builtin_ia32_sqrtss ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rcp_ss (__m128 __A) +{ + return (__m128) __builtin_ia32_rcpss ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rsqrt_ss (__m128 __A) +{ + return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_minss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_maxss ((__v4sf)__A, (__v4sf)__B); +} + +/* Perform the respective operation on the four SPFP values in A and B. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_addps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_subps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_mulps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_divps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_ps (__m128 __A) +{ + return (__m128) __builtin_ia32_sqrtps ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rcp_ps (__m128 __A) +{ + return (__m128) __builtin_ia32_rcpps ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rsqrt_ps (__m128 __A) +{ + return (__m128) __builtin_ia32_rsqrtps ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_minps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_maxps ((__v4sf)__A, (__v4sf)__B); +} + +/* Perform logical bit-wise operations on 128-bit values. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_ps (__m128 __A, __m128 __B) +{ + return __builtin_ia32_andps (__A, __B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_ps (__m128 __A, __m128 __B) +{ + return __builtin_ia32_andnps (__A, __B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_ps (__m128 __A, __m128 __B) +{ + return __builtin_ia32_orps (__A, __B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_ps (__m128 __A, __m128 __B) +{ + return __builtin_ia32_xorps (__A, __B); +} + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf) __A, + (__v4sf) + __builtin_ia32_cmpltss ((__v4sf) __B, + (__v4sf) + __A)); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf) __A, + (__v4sf) + __builtin_ia32_cmpless ((__v4sf) __B, + (__v4sf) + __A)); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpneqss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpnltss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpnless ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf) __A, + (__v4sf) + __builtin_ia32_cmpnltss ((__v4sf) __B, + (__v4sf) + __A)); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf) __A, + (__v4sf) + __builtin_ia32_cmpnless ((__v4sf) __B, + (__v4sf) + __A)); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpordss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpunordss ((__v4sf)__A, (__v4sf)__B); +} + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpeqps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpneqps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpnltps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpordps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpunordps ((__v4sf)__A, (__v4sf)__B); +} + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comieq_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comieq ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comilt_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comilt ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comile_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comile ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comigt_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comigt ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comige_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comige ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comineq_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comineq ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomieq_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomieq ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomilt_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomilt ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomile_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomile ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomigt_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomigt ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomige_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomige ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomineq_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomineq ((__v4sf)__A, (__v4sf)__B); +} + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si32 (__m128 __A) +{ + return __builtin_ia32_cvtss2si ((__v4sf) __A); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_ss2si (__m128 __A) +{ + return _mm_cvtss_si32 (__A); +} + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si64 (__m128 __A) +{ + return __builtin_ia32_cvtss2si64 ((__v4sf) __A); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si64x (__m128 __A) +{ + return __builtin_ia32_cvtss2si64 ((__v4sf) __A); +} +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi32 (__m128 __A) +{ + return (__m64) __builtin_ia32_cvtps2pi ((__v4sf) __A); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_ps2pi (__m128 __A) +{ + return _mm_cvtps_pi32 (__A); +} + +/* Truncate the lower SPFP value to a 32-bit integer. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si32 (__m128 __A) +{ + return __builtin_ia32_cvttss2si ((__v4sf) __A); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtt_ss2si (__m128 __A) +{ + return _mm_cvttss_si32 (__A); +} + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si64 (__m128 __A) +{ + return __builtin_ia32_cvttss2si64 ((__v4sf) __A); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si64x (__m128 __A) +{ + return __builtin_ia32_cvttss2si64 ((__v4sf) __A); +} +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttps_pi32 (__m128 __A) +{ + return (__m64) __builtin_ia32_cvttps2pi ((__v4sf) __A); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtt_ps2pi (__m128 __A) +{ + return _mm_cvttps_pi32 (__A); +} + +/* Convert B to a SPFP value and insert it as element zero in A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_ss (__m128 __A, int __B) +{ + return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_si2ss (__m128 __A, int __B) +{ + return _mm_cvtsi32_ss (__A, __B); +} + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ + +/* Intel intrinsic. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_ss (__m128 __A, long long __B) +{ + return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); +} + +/* Microsoft intrinsic. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_ss (__m128 __A, long long __B) +{ + return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); +} +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +{ + return (__m128) __builtin_ia32_cvtpi2ps ((__v4sf) __A, (__v2si)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +{ + return _mm_cvtpi32_ps (__A, __B); +} + +/* Convert the four signed 16-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi16_ps (__m64 __A) +{ + __v4hi __sign; + __v2si __hisi, __losi; + __v4sf __zero, __ra, __rb; + + /* This comparison against zero gives us a mask that can be used to + fill in the missing sign bits in the unpack operations below, so + that we get signed values after unpacking. */ + __sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A); + + /* Convert the four words to doublewords. */ + __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign); + __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign); + + /* Convert the doublewords to floating point two at a time. */ + __zero = (__v4sf) _mm_setzero_ps (); + __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi); + __rb = __builtin_ia32_cvtpi2ps (__ra, __losi); + + return (__m128) __builtin_ia32_movlhps (__ra, __rb); +} + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpu16_ps (__m64 __A) +{ + __v2si __hisi, __losi; + __v4sf __zero, __ra, __rb; + + /* Convert the four words to doublewords. */ + __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL); + __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL); + + /* Convert the doublewords to floating point two at a time. */ + __zero = (__v4sf) _mm_setzero_ps (); + __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi); + __rb = __builtin_ia32_cvtpi2ps (__ra, __losi); + + return (__m128) __builtin_ia32_movlhps (__ra, __rb); +} + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi8_ps (__m64 __A) +{ + __v8qi __sign; + + /* This comparison against zero gives us a mask that can be used to + fill in the missing sign bits in the unpack operations below, so + that we get signed values after unpacking. */ + __sign = __builtin_ia32_pcmpgtb ((__v8qi)0LL, (__v8qi)__A); + + /* Convert the four low bytes to words. */ + __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __sign); + + return _mm_cvtpi16_ps(__A); +} + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpu8_ps(__m64 __A) +{ + __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, (__v8qi)0LL); + return _mm_cvtpu16_ps(__A); +} + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +{ + __v4sf __zero = (__v4sf) _mm_setzero_ps (); + __v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A); + __v4sf __sfb = __builtin_ia32_cvtpi2ps (__sfa, (__v2si)__B); + return (__m128) __builtin_ia32_movlhps (__sfa, __sfb); +} + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi16(__m128 __A) +{ + __v4sf __hisf = (__v4sf)__A; + __v4sf __losf = __builtin_ia32_movhlps (__hisf, __hisf); + __v2si __hisi = __builtin_ia32_cvtps2pi (__hisf); + __v2si __losi = __builtin_ia32_cvtps2pi (__losf); + return (__m64) __builtin_ia32_packssdw (__hisi, __losi); +} + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi8(__m128 __A) +{ + __v4hi __tmp = (__v4hi) _mm_cvtps_pi16 (__A); + return (__m64) __builtin_ia32_packsswb (__tmp, (__v4hi)0LL); +} + +/* Selects four specific SPFP values from A and B based on MASK. */ +#ifdef __OPTIMIZE__ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_ps (__m128 __A, __m128 __B, int const __mask) +{ + return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask); +} +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), (int)(MASK))) +#endif + +/* Selects and interleaves the upper two SPFP values from A and B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_unpckhps ((__v4sf)__A, (__v4sf)__B); +} + +/* Selects and interleaves the lower two SPFP values from A and B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_unpcklps ((__v4sf)__A, (__v4sf)__B); +} + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadh_pi (__m128 __A, __m64 const *__P) +; /* fixme_delete { + return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (const __v2sf *)__P); +} */ + +/* Stores the upper two SPFP values of A into P. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeh_pi (__m64 *__P, __m128 __A) +; /* fixme_delete { + __builtin_ia32_storehps ((__v2sf *)__P, (__v4sf)__A); +} */ + +/* Moves the upper two values of B into the lower two values of A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movehl_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movhlps ((__v4sf)__A, (__v4sf)__B); +} + +/* Moves the lower two values of B into the upper two values of A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movelh_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movlhps ((__v4sf)__A, (__v4sf)__B); +} + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_pi (__m128 __A, __m64 const *__P) +; /* fixme_delete { + return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (const __v2sf *)__P); +} */ + +/* Stores the lower two SPFP values of A into P. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_pi (__m64 *__P, __m128 __A) +; /* fixme_delete { + __builtin_ia32_storelps ((__v2sf *)__P, (__v4sf)__A); +} */ + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_ps (__m128 __A) +{ + return __builtin_ia32_movmskps ((__v4sf)__A); +} + +/* Return the contents of the control register. */ +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_getcsr (void) +{ + return __builtin_ia32_stmxcsr (); +} + +/* Read exception bits from the control register. */ +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_EXCEPTION_STATE (void) +{ + return _mm_getcsr() & _MM_EXCEPT_MASK; +} + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_EXCEPTION_MASK (void) +{ + return _mm_getcsr() & _MM_MASK_MASK; +} + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_ROUNDING_MODE (void) +{ + return _mm_getcsr() & _MM_ROUND_MASK; +} + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_FLUSH_ZERO_MODE (void) +{ + return _mm_getcsr() & _MM_FLUSH_ZERO_MASK; +} + +/* Set the control register to I. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setcsr (unsigned int __I) +{ + __builtin_ia32_ldmxcsr (__I); +} + +/* Set exception bits in the control register. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +{ + _mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | __mask); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +{ + _mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | __mask); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_ROUNDING_MODE (unsigned int __mode) +{ + _mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | __mode); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +{ + _mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | __mode); +} + +/* Create a vector with element 0 as F and the rest zero. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ss (float __F) +{ + return __extension__ (__m128)(__v4sf){ __F, 0.0f, 0.0f, 0.0f }; +} + +/* Create a vector with all four elements equal to F. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_ps (float __F) +{ + return __extension__ (__m128)(__v4sf){ __F, __F, __F, __F }; +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ps1 (float __F) +{ + return _mm_set1_ps (__F); +} + +/* Create a vector with element 0 as *P and the rest zero. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ss (float const *__P) +{ + return _mm_set_ss (*__P); +} + +/* Create a vector with all four elements equal to *P. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load1_ps (float const *__P) +{ + return _mm_set1_ps (*__P); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ps1 (float const *__P) +{ + return _mm_load1_ps (__P); +} + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ps (float const *__P) +{ + return (__m128) *(__v4sf *)__P; +} + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_ps (float const *__P) +{ + return (__m128) __builtin_ia32_loadups (__P); +} + +/* Load four SPFP values in reverse order. The address must be aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadr_ps (float const *__P) +{ + __v4sf __tmp = *(__v4sf *)__P; + return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,1,2,3)); +} + +/* Create the vector [Z Y X W]. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +{ + return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z }; +} + +/* Create the vector [W X Y Z]. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +{ + return __extension__ (__m128)(__v4sf){ __Z, __Y, __X, __W }; +} + +/* Stores the lower SPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ss (float *__P, __m128 __A) +{ + *__P = __builtin_ia32_vec_ext_v4sf ((__v4sf)__A, 0); +} + +extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_f32 (__m128 __A) +{ + return __builtin_ia32_vec_ext_v4sf ((__v4sf)__A, 0); +} + +/* Store four SPFP values. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ps (float *__P, __m128 __A) +{ + *(__v4sf *)__P = (__v4sf)__A; +} + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_ps (float *__P, __m128 __A) +{ + __builtin_ia32_storeups (__P, (__v4sf)__A); +} + +/* Store the lower SPFP value across four words. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store1_ps (float *__P, __m128 __A) +{ + __v4sf __va = (__v4sf)__A; + __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,0,0,0)); + _mm_storeu_ps (__P, __tmp); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ps1 (float *__P, __m128 __A) +{ + _mm_store1_ps (__P, __A); +} + +/* Store four SPFP values in reverse order. The address must be aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storer_ps (float *__P, __m128 __A) +{ + __v4sf __va = (__v4sf)__A; + __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,1,2,3)); + _mm_store_ps (__P, __tmp); +} + +/* Sets the low SPFP value of A from the low value of B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf)__A, (__v4sf)__B); +} + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#ifdef __OPTIMIZE__ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_pi16 (__m64 const __A, int const __N) +{ + return __builtin_ia32_vec_ext_v4hi ((__v4hi)__A, __N); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pextrw (__m64 const __A, int const __N) +{ + return _mm_extract_pi16 (__A, __N); +} +#else +#define _mm_extract_pi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v4hi ((__v4hi)(__m64)(A), (int)(N))) + +#define _m_pextrw(A, N) _mm_extract_pi16(A, N) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#ifdef __OPTIMIZE__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +{ + return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) +{ + return _mm_insert_pi16 (__A, __D, __N); +} +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(__m64)(A), \ + (int)(D), (int)(N))) + +#define _m_pinsrw(A, D, N) _mm_insert_pi16(A, D, N) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pi16 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pmaxsw ((__v4hi)__A, (__v4hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaxsw (__m64 __A, __m64 __B) +{ + return _mm_max_pi16 (__A, __B); +} + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pu8 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pmaxub ((__v8qi)__A, (__v8qi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaxub (__m64 __A, __m64 __B) +{ + return _mm_max_pu8 (__A, __B); +} + +/* Compute the element-wise minimum of signed 16-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pi16 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pminsw ((__v4hi)__A, (__v4hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pminsw (__m64 __A, __m64 __B) +{ + return _mm_min_pi16 (__A, __B); +} + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pu8 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pminub ((__v8qi)__A, (__v8qi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pminub (__m64 __A, __m64 __B) +{ + return _mm_min_pu8 (__A, __B); +} + +/* Create an 8-bit mask of the signs of 8-bit values. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_pi8 (__m64 __A) +{ + return __builtin_ia32_pmovmskb ((__v8qi)__A); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmovmskb (__m64 __A) +{ + return _mm_movemask_pi8 (__A); +} + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pmulhuw ((__v4hi)__A, (__v4hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmulhuw (__m64 __A, __m64 __B) +{ + return _mm_mulhi_pu16 (__A, __B); +} + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#ifdef __OPTIMIZE__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_pi16 (__m64 __A, int const __N) +{ + return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pshufw (__m64 __A, int const __N) +{ + return _mm_shuffle_pi16 (__A, __N); +} +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N))) + +#define _m_pshufw(A, N) _mm_shuffle_pi16 (A, N) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +{ + __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +{ + _mm_maskmove_si64 (__A, __N, __P); +} + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_pu8 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pavgb ((__v8qi)__A, (__v8qi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pavgb (__m64 __A, __m64 __B) +{ + return _mm_avg_pu8 (__A, __B); +} + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_pu16 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pavgw ((__v4hi)__A, (__v4hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pavgw (__m64 __A, __m64 __B) +{ + return _mm_avg_pu16 (__A, __B); +} + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sad_pu8 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_psadbw ((__v8qi)__A, (__v8qi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psadbw (__m64 __A, __m64 __B) +{ + return _mm_sad_pu8 (__A, __B); +} + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#ifdef __OPTIMIZE__ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_prefetch (const void *__P, enum _mm_hint __I) +{ + __builtin_prefetch (__P, 0, __I); +} +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_pi (__m64 *__P, __m64 __A) +{ + __builtin_ia32_movntq ((unsigned long long *)__P, (unsigned long long)__A); +} + +/* Likewise. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_ps (float *__P, __m128 __A) +{ + __builtin_ia32_movntps (__P, (__v4sf)__A); +} + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sfence (void) +{ + __builtin_ia32_sfence (); +} + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_pause (void) +{ + __asm__ __volatile__ ("rep; nop" : : ); +} + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ + __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \ + __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); \ + __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); \ + __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); \ + __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); \ + (row0) = __builtin_ia32_movlhps (__t0, __t1); \ + (row1) = __builtin_ia32_movhlps (__t1, __t0); \ + (row2) = __builtin_ia32_movlhps (__t2, __t3); \ + (row3) = __builtin_ia32_movhlps (__t3, __t2); \ +} while (0) + +/* For backward source compatibility. */ +#ifdef __SSE2__ +# include +#endif + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.6/bits/stl_algo.h b/GCC_XML/Support/GCC/4.6/bits/stl_algo.h new file mode 100644 index 0000000..2e5c2c8 --- /dev/null +++ b/GCC_XML/Support/GCC/4.6/bits/stl_algo.h @@ -0,0 +1,6173 @@ +// Algorithm implementation -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +// 2010, 2011 +// 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 + +#include // for rand +#include +#include +#include // for _Temporary_buffer + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +#include // for std::uniform_int_distribution +#include // for std::bind +#endif + +// 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 to *__a + template + void + __move_median_first(_Iterator __a, _Iterator __b, _Iterator __c) + { + // concept requirements + __glibcxx_function_requires(_LessThanComparableConcept< + typename iterator_traits<_Iterator>::value_type>) + + if (*__a < *__b) + { + if (*__b < *__c) + std::iter_swap(__a, __b); + else if (*__a < *__c) + std::iter_swap(__a, __c); + } + else if (*__a < *__c) + return; + else if (*__b < *__c) + std::iter_swap(__a, __c); + else + std::iter_swap(__a, __b); + } + + /// Swaps the median value of *__a, *__b and *__c under __comp to *__a + template + void + __move_median_first(_Iterator __a, _Iterator __b, _Iterator __c, + _Compare __comp) + { + // concept requirements + __glibcxx_function_requires(_BinaryFunctionConcept<_Compare, bool, + typename iterator_traits<_Iterator>::value_type, + typename iterator_traits<_Iterator>::value_type>) + + if (__comp(*__a, *__b)) + { + if (__comp(*__b, *__c)) + std::iter_swap(__a, __b); + else if (__comp(*__a, *__c)) + std::iter_swap(__a, __c); + } + else if (__comp(*__a, *__c)) + return; + else if (__comp(*__b, *__c)) + std::iter_swap(__a, __c); + else + std::iter_swap(__a, __b); + } + + // for_each + + /// This is an overload used by find() for the Input Iterator case. + template + inline _InputIterator + __find(_InputIterator __first, _InputIterator __last, + const _Tp& __val, input_iterator_tag) + { + while (__first != __last && !(*__first == __val)) + ++__first; + return __first; + } + + /// This is an overload used by find_if() for the Input Iterator case. + template + inline _InputIterator + __find_if(_InputIterator __first, _InputIterator __last, + _Predicate __pred, input_iterator_tag) + { + while (__first != __last && !bool(__pred(*__first))) + ++__first; + return __first; + } + + /// This is an overload used by find() for the RAI case. + template + _RandomAccessIterator + __find(_RandomAccessIterator __first, _RandomAccessIterator __last, + const _Tp& __val, random_access_iterator_tag) + { + typename iterator_traits<_RandomAccessIterator>::difference_type + __trip_count = (__last - __first) >> 2; + + for (; __trip_count > 0; --__trip_count) + { + if (*__first == __val) + return __first; + ++__first; + + if (*__first == __val) + return __first; + ++__first; + + if (*__first == __val) + return __first; + ++__first; + + if (*__first == __val) + return __first; + ++__first; + } + + switch (__last - __first) + { + case 3: + if (*__first == __val) + return __first; + ++__first; + case 2: + if (*__first == __val) + return __first; + ++__first; + case 1: + if (*__first == __val) + return __first; + ++__first; + case 0: + default: + return __last; + } + } + + /// This is an overload used by find_if() 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; + } + } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + /// This is an overload used by find_if_not() for the Input Iterator case. + template + inline _InputIterator + __find_if_not(_InputIterator __first, _InputIterator __last, + _Predicate __pred, input_iterator_tag) + { + while (__first != __last && bool(__pred(*__first))) + ++__first; + return __first; + } + + /// This is an overload used by find_if_not() for the RAI case. + template + _RandomAccessIterator + __find_if_not(_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 (!bool(__pred(*__first))) + return __first; + ++__first; + + if (!bool(__pred(*__first))) + return __first; + ++__first; + + if (!bool(__pred(*__first))) + return __first; + ++__first; + + if (!bool(__pred(*__first))) + return __first; + ++__first; + } + + switch (__last - __first) + { + case 3: + if (!bool(__pred(*__first))) + return __first; + ++__first; + case 2: + if (!bool(__pred(*__first))) + return __first; + ++__first; + case 1: + if (!bool(__pred(*__first))) + return __first; + ++__first; + case 0: + default: + return __last; + } + } +#endif + + // set_difference + // set_intersection + // set_symmetric_difference + // set_union + // for_each + // find + // find_if + // find_first_of + // adjacent_find + // count + // count_if + // search + + /** + * This is an uglified + * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&) + * overloaded for forward iterators. + */ + template + _ForwardIterator + __search_n(_ForwardIterator __first, _ForwardIterator __last, + _Integer __count, const _Tp& __val, + std::forward_iterator_tag) + { + __first = _GLIBCXX_STD_A::find(__first, __last, __val); + while (__first != __last) + { + typename iterator_traits<_ForwardIterator>::difference_type + __n = __count; + _ForwardIterator __i = __first; + ++__i; + while (__i != __last && __n != 1 && *__i == __val) + { + ++__i; + --__n; + } + if (__n == 1) + return __first; + if (__i == __last) + return __last; + __first = _GLIBCXX_STD_A::find(++__i, __last, __val); + } + return __last; + } + + /** + * This is an uglified + * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&) + * overloaded for random access iterators. + */ + template + _RandomAccessIter + __search_n(_RandomAccessIter __first, _RandomAccessIter __last, + _Integer __count, const _Tp& __val, + std::random_access_iterator_tag) + { + + typedef typename std::iterator_traits<_RandomAccessIter>::difference_type + _DistanceType; + + _DistanceType __tailSize = __last - __first; + const _DistanceType __pattSize = __count; + + if (__tailSize < __pattSize) + return __last; + + const _DistanceType __skipOffset = __pattSize - 1; + _RandomAccessIter __lookAhead = __first + __skipOffset; + __tailSize -= __pattSize; + + while (1) // the main loop... + { + // __lookAhead here is always pointing to the last element of next + // possible match. + while (!(*__lookAhead == __val)) // the skip loop... + { + if (__tailSize < __pattSize) + return __last; // Failure + __lookAhead += __pattSize; + __tailSize -= __pattSize; + } + _DistanceType __remainder = __skipOffset; + for (_RandomAccessIter __backTrack = __lookAhead - 1; + *__backTrack == __val; --__backTrack) + { + if (--__remainder == 0) + return (__lookAhead - __skipOffset); // Success + } + if (__remainder > __tailSize) + return __last; // Failure + __lookAhead += __remainder; + __tailSize -= __remainder; + } + } + + // search_n + + /** + * This is an uglified + * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&, + * _BinaryPredicate) + * overloaded for forward iterators. + */ + template + _ForwardIterator + __search_n(_ForwardIterator __first, _ForwardIterator __last, + _Integer __count, const _Tp& __val, + _BinaryPredicate __binary_pred, std::forward_iterator_tag) + { + while (__first != __last && !bool(__binary_pred(*__first, __val))) + ++__first; + + while (__first != __last) + { + typename iterator_traits<_ForwardIterator>::difference_type + __n = __count; + _ForwardIterator __i = __first; + ++__i; + while (__i != __last && __n != 1 && bool(__binary_pred(*__i, __val))) + { + ++__i; + --__n; + } + if (__n == 1) + return __first; + if (__i == __last) + return __last; + __first = ++__i; + while (__first != __last + && !bool(__binary_pred(*__first, __val))) + ++__first; + } + return __last; + } + + /** + * This is an uglified + * search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&, + * _BinaryPredicate) + * overloaded for random access iterators. + */ + template + _RandomAccessIter + __search_n(_RandomAccessIter __first, _RandomAccessIter __last, + _Integer __count, const _Tp& __val, + _BinaryPredicate __binary_pred, std::random_access_iterator_tag) + { + + typedef typename std::iterator_traits<_RandomAccessIter>::difference_type + _DistanceType; + + _DistanceType __tailSize = __last - __first; + const _DistanceType __pattSize = __count; + + if (__tailSize < __pattSize) + return __last; + + const _DistanceType __skipOffset = __pattSize - 1; + _RandomAccessIter __lookAhead = __first + __skipOffset; + __tailSize -= __pattSize; + + while (1) // the main loop... + { + // __lookAhead here is always pointing to the last element of next + // possible match. + while (!bool(__binary_pred(*__lookAhead, __val))) // the skip loop... + { + if (__tailSize < __pattSize) + return __last; // Failure + __lookAhead += __pattSize; + __tailSize -= __pattSize; + } + _DistanceType __remainder = __skipOffset; + for (_RandomAccessIter __backTrack = __lookAhead - 1; + __binary_pred(*__backTrack, __val); --__backTrack) + { + if (--__remainder == 0) + return (__lookAhead - __skipOffset); // Success + } + if (__remainder > __tailSize) + return __last; // Failure + __lookAhead += __remainder; + __tailSize -= __remainder; + } + } + + // find_end for forward iterators. + template + _ForwardIterator1 + __find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1, + _ForwardIterator2 __first2, _ForwardIterator2 __last2, + forward_iterator_tag, forward_iterator_tag) + { + if (__first2 == __last2) + return __last1; + else + { + _ForwardIterator1 __result = __last1; + while (1) + { + _ForwardIterator1 __new_result + = _GLIBCXX_STD_A::search(__first1, __last1, __first2, __last2); + if (__new_result == __last1) + return __result; + else + { + __result = __new_result; + __first1 = __new_result; + ++__first1; + } + } + } + } + + 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; + else + { + _ForwardIterator1 __result = __last1; + while (1) + { + _ForwardIterator1 __new_result + = _GLIBCXX_STD_A::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) + { + // 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 = _GLIBCXX_STD_A::search(_RevIterator1(__last1), + __rlast1, + _RevIterator2(__last2), + __rlast2); + + if (__rresult == __rlast1) + return __last1; + else + { + _BidirectionalIterator1 __result = __rresult.base(); + std::advance(__result, -std::distance(__first2, __last2)); + return __result; + } + } + + 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 [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) + { + // 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)); + } + + /** + * @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), + __comp); + } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + /** + * @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, __pred, + std::__iterator_category(__first)); + } + + /** + * @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 + + + /** + * @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 + _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); + + for (; __first != __last; ++__first) + if (!(*__first == __value)) + { + *__result = *__first; + ++__result; + } + return __result; + } + + /** + * @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 + _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); + + for (; __first != __last; ++__first) + if (!bool(__pred(*__first))) + { + *__result = *__first; + ++__result; + } + return __result; + } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + /** + * @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) + { + for (; __n > 0; --__n) + { + *__result = *__first; + ++__first; + ++__result; + } + 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 + + /** + * @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 + _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); + + __first = _GLIBCXX_STD_A::find(__first, __last, __value); + if(__first == __last) + return __first; + _ForwardIterator __result = __first; + ++__first; + for(; __first != __last; ++__first) + if(!(*__first == __value)) + { + *__result = _GLIBCXX_MOVE(*__first); + ++__result; + } + return __result; + } + + /** + * @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 + _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); + + __first = _GLIBCXX_STD_A::find_if(__first, __last, __pred); + if(__first == __last) + return __first; + _ForwardIterator __result = __first; + ++__first; + for(; __first != __last; ++__first) + if(!bool(__pred(*__first))) + { + *__result = _GLIBCXX_MOVE(*__first); + ++__result; + } + return __result; + } + + /** + * @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 + _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); + + // Skip the beginning, if already unique. + __first = _GLIBCXX_STD_A::adjacent_find(__first, __last); + if (__first == __last) + return __last; + + // Do the real copy work. + _ForwardIterator __dest = __first; + ++__first; + while (++__first != __last) + if (!(*__dest == *__first)) + *++__dest = _GLIBCXX_MOVE(*__first); + return ++__dest; + } + + /** + * @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 + _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); + + // Skip the beginning, if already unique. + __first = _GLIBCXX_STD_A::adjacent_find(__first, __last, __binary_pred); + if (__first == __last) + return __last; + + // Do the real copy work. + _ForwardIterator __dest = __first; + ++__first; + while (++__first != __last) + if (!bool(__binary_pred(*__dest, *__first))) + *++__dest = _GLIBCXX_MOVE(*__first); + return ++__dest; + } + + /** + * This is an uglified unique_copy(_InputIterator, _InputIterator, + * _OutputIterator) + * overloaded for forward iterators and output iterator as result. + */ + template + _OutputIterator + __unique_copy(_ForwardIterator __first, _ForwardIterator __last, + _OutputIterator __result, + forward_iterator_tag, output_iterator_tag) + { + // concept requirements -- taken care of in dispatching function + _ForwardIterator __next = __first; + *__result = *__first; + while (++__next != __last) + if (!(*__first == *__next)) + { + __first = __next; + *++__result = *__first; + } + return ++__result; + } + + /** + * This is an uglified unique_copy(_InputIterator, _InputIterator, + * _OutputIterator) + * overloaded for input iterators and output iterator as result. + */ + template + _OutputIterator + __unique_copy(_InputIterator __first, _InputIterator __last, + _OutputIterator __result, + input_iterator_tag, output_iterator_tag) + { + // concept requirements -- taken care of in dispatching function + typename iterator_traits<_InputIterator>::value_type __value = *__first; + *__result = __value; + while (++__first != __last) + if (!(__value == *__first)) + { + __value = *__first; + *++__result = __value; + } + return ++__result; + } + + /** + * This is an uglified unique_copy(_InputIterator, _InputIterator, + * _OutputIterator) + * overloaded for input iterators and forward iterator as result. + */ + template + _ForwardIterator + __unique_copy(_InputIterator __first, _InputIterator __last, + _ForwardIterator __result, + input_iterator_tag, forward_iterator_tag) + { + // concept requirements -- taken care of in dispatching function + *__result = *__first; + while (++__first != __last) + if (!(*__result == *__first)) + *++__result = *__first; + return ++__result; + } + + /** + * 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 (!bool(__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; + *__result = __value; + while (++__first != __last) + if (!bool(__binary_pred(__value, *__first))) + { + __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 (!bool(__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)-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; + } + + /// This is a helper function for the rotate algorithm. + template + void + __rotate(_ForwardIterator __first, + _ForwardIterator __middle, + _ForwardIterator __last, + forward_iterator_tag) + { + if (__first == __middle || __last == __middle) + return; + + _ForwardIterator __first2 = __middle; + do + { + std::iter_swap(__first, __first2); + ++__first; + ++__first2; + if (__first == __middle) + __middle = __first2; + } + while (__first2 != __last); + + __first2 = __middle; + + while (__first2 != __last) + { + std::iter_swap(__first, __first2); + ++__first; + ++__first2; + if (__first == __middle) + __middle = __first2; + else if (__first2 == __last) + __first2 = __middle; + } + } + + /// This is a helper function for the rotate algorithm. + template + void + __rotate(_BidirectionalIterator __first, + _BidirectionalIterator __middle, + _BidirectionalIterator __last, + bidirectional_iterator_tag) + { + // concept requirements + __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< + _BidirectionalIterator>) + + if (__first == __middle || __last == __middle) + return; + + 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()); + else + std::__reverse(__first, __middle, bidirectional_iterator_tag()); + } + + /// This is a helper function for the rotate algorithm. + template + void + __rotate(_RandomAccessIterator __first, + _RandomAccessIterator __middle, + _RandomAccessIterator __last, + random_access_iterator_tag) + { + // concept requirements + __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>) + + if (__first == __middle || __last == __middle) + return; + + 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; + } + + _RandomAccessIterator __p = __first; + + 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; + } + _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; + 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; + } + _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; + std::swap(__n, __k); + } + } + } + + /** + * @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 Nothing. + * + * 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 @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 void + 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); + + typedef typename iterator_traits<_ForwardIterator>::iterator_category + _IterType; + std::__rotate(__first, __middle, __last, _IterType()); + } + + /** + * @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 @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 + _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... + template + _ForwardIterator + __inplace_stable_partition(_ForwardIterator __first, + _ForwardIterator __last, + _Predicate __pred, _Distance __len) + { + if (__len == 1) + return __pred(*__first) ? __last : __first; + _ForwardIterator __middle = __first; + std::advance(__middle, __len / 2); + _ForwardIterator __begin = std::__inplace_stable_partition(__first, + __middle, + __pred, + __len / 2); + _ForwardIterator __end = std::__inplace_stable_partition(__middle, __last, + __pred, + __len + - __len / 2); + std::rotate(__begin, __middle, __end); + std::advance(__begin, std::distance(__middle, __end)); + return __begin; + } + + /// This is a helper function... + template + _ForwardIterator + __stable_partition_adaptive(_ForwardIterator __first, + _ForwardIterator __last, + _Predicate __pred, _Distance __len, + _Pointer __buffer, + _Distance __buffer_size) + { + if (__len <= __buffer_size) + { + _ForwardIterator __result1 = __first; + _Pointer __result2 = __buffer; + 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; + } + else + { + _ForwardIterator __middle = __first; + std::advance(__middle, __len / 2); + _ForwardIterator __begin = + std::__stable_partition_adaptive(__first, __middle, __pred, + __len / 2, __buffer, + __buffer_size); + _ForwardIterator __end = + std::__stable_partition_adaptive(__middle, __last, __pred, + __len - __len / 2, + __buffer, __buffer_size); + std::rotate(__begin, __middle, __end); + std::advance(__begin, std::distance(__middle, __end)); + return __begin; + } + } + + /** + * @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 + _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); + + if (__first == __last) + return __first; + else + { + typedef typename iterator_traits<_ForwardIterator>::value_type + _ValueType; + typedef typename iterator_traits<_ForwardIterator>::difference_type + _DistanceType; + + _Temporary_buffer<_ForwardIterator, _ValueType> __buf(__first, + __last); + if (__buf.size() > 0) + return + std::__stable_partition_adaptive(__first, __last, __pred, + _DistanceType(__buf.requested_size()), + __buf.begin(), + _DistanceType(__buf.size())); + else + return + std::__inplace_stable_partition(__first, __last, __pred, + _DistanceType(__buf.requested_size())); + } + } + + /// This is a helper function for the sort routines. + template + void + __heap_select(_RandomAccessIterator __first, + _RandomAccessIterator __middle, + _RandomAccessIterator __last) + { + std::make_heap(__first, __middle); + for (_RandomAccessIterator __i = __middle; __i < __last; ++__i) + if (*__i < *__first) + std::__pop_heap(__first, __middle, __i); + } + + /// 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 + + /** + * @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 @p i and @j are iterators in the range + * @p [result_first,result_first+N) such that @i precedes @j then + * @p *j<*i is false. + * The value returned is @p result_first+N. + */ + template + _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); + + 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); + while (__first != __last) + { + if (*__first < *__result_first) + std::__adjust_heap(__result_first, _DistanceType(0), + _DistanceType(__result_real_last + - __result_first), + _InputValueType(*__first)); + ++__first; + } + std::sort_heap(__result_first, __result_real_last); + return __result_real_last; + } + + /** + * @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 @p i and @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 + _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); + + 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; + } + + /// This is a helper function for the sort routine. + template + void + __unguarded_linear_insert(_RandomAccessIterator __last) + { + typename iterator_traits<_RandomAccessIterator>::value_type + __val = _GLIBCXX_MOVE(*__last); + _RandomAccessIterator __next = __last; + --__next; + while (__val < *__next) + { + *__last = _GLIBCXX_MOVE(*__next); + __last = __next; + --__next; + } + *__last = _GLIBCXX_MOVE(__val); + } + + /// 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) + { + if (__first == __last) + return; + + for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) + { + if (*__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); + } + } + + /// 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, __comp); + } + } + + /// This is a helper function for the sort routine. + template + inline void + __unguarded_insertion_sort(_RandomAccessIterator __first, + _RandomAccessIterator __last) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + + for (_RandomAccessIterator __i = __first; __i != __last; ++__i) + std::__unguarded_linear_insert(__i); + } + + /// This is a helper function for the sort routine. + template + inline void + __unguarded_insertion_sort(_RandomAccessIterator __first, + _RandomAccessIterator __last, _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + + for (_RandomAccessIterator __i = __first; __i != __last; ++__i) + std::__unguarded_linear_insert(__i, __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) + { + if (__last - __first > int(_S_threshold)) + { + std::__insertion_sort(__first, __first + int(_S_threshold)); + std::__unguarded_insertion_sort(__first + int(_S_threshold), __last); + } + else + std::__insertion_sort(__first, __last); + } + + /// 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, const _Tp& __pivot) + { + while (true) + { + while (*__first < __pivot) + ++__first; + --__last; + while (__pivot < *__last) + --__last; + if (!(__first < __last)) + return __first; + std::iter_swap(__first, __last); + ++__first; + } + } + + /// This is a helper function... + template + _RandomAccessIterator + __unguarded_partition(_RandomAccessIterator __first, + _RandomAccessIterator __last, + const _Tp& __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) + { + _RandomAccessIterator __mid = __first + (__last - __first) / 2; + std::__move_median_first(__first, __mid, (__last - 1)); + return std::__unguarded_partition(__first + 1, __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_first(__first, __mid, (__last - 1), __comp); + return std::__unguarded_partition(__first + 1, __last, *__first, __comp); + } + + /// This is a helper function for the sort routine. + template + void + __introsort_loop(_RandomAccessIterator __first, + _RandomAccessIterator __last, + _Size __depth_limit) + { + while (__last - __first > int(_S_threshold)) + { + if (__depth_limit == 0) + { + _GLIBCXX_STD_A::partial_sort(__first, __last, __last); + return; + } + --__depth_limit; + _RandomAccessIterator __cut = + std::__unguarded_partition_pivot(__first, __last); + std::__introsort_loop(__cut, __last, __depth_limit); + __last = __cut; + } + } + + /// 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) + { + _GLIBCXX_STD_A::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 + void + __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth, + _RandomAccessIterator __last, _Size __depth_limit) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + + while (__last - __first > 3) + { + if (__depth_limit == 0) + { + std::__heap_select(__first, __nth + 1, __last); + + // 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); + if (__cut <= __nth) + __first = __cut; + else + __last = __cut; + } + std::__insertion_sort(__first, __last); + } + + template + void + __introselect(_RandomAccessIterator __first, _RandomAccessIterator __nth, + _RandomAccessIterator __last, _Size __depth_limit, + _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + + 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 @a 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 @a val, or end() if every element is less + * than @a val. + * @ingroup binary_search_algorithms + * + * The comparison function should have the same effects on ordering as + * the function used for the initial sort. + */ + template + _ForwardIterator + lower_bound(_ForwardIterator __first, _ForwardIterator __last, + const _Tp& __val, _Compare __comp) + { + typedef typename iterator_traits<_ForwardIterator>::value_type + _ValueType; + typedef typename iterator_traits<_ForwardIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType, _Tp>) + __glibcxx_requires_partitioned_lower_pred(__first, __last, + __val, __comp); + + _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 last position in which @a 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 @a val, + * or end() if no elements are greater than @a val. + * @ingroup binary_search_algorithms + */ + template + _ForwardIterator + upper_bound(_ForwardIterator __first, _ForwardIterator __last, + const _Tp& __val) + { + typedef typename iterator_traits<_ForwardIterator>::value_type + _ValueType; + typedef typename iterator_traits<_ForwardIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) + __glibcxx_function_requires(_LessThanOpConcept<_Tp, _ValueType>) + __glibcxx_requires_partitioned_upper(__first, __last, __val); + + _DistanceType __len = std::distance(__first, __last); + + while (__len > 0) + { + _DistanceType __half = __len >> 1; + _ForwardIterator __middle = __first; + std::advance(__middle, __half); + if (__val < *__middle) + __len = __half; + else + { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + } + return __first; + } + + /** + * @brief Finds the last position in which @a 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 @a val, + * or end() if no elements are greater than @a val. + * @ingroup binary_search_algorithms + * + * The comparison function should have the same effects on ordering as + * the function used for the initial sort. + */ + template + _ForwardIterator + upper_bound(_ForwardIterator __first, _ForwardIterator __last, + const _Tp& __val, _Compare __comp) + { + typedef typename iterator_traits<_ForwardIterator>::value_type + _ValueType; + typedef typename iterator_traits<_ForwardIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _Tp, _ValueType>) + __glibcxx_requires_partitioned_upper_pred(__first, __last, + __val, __comp); + + _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 largest subrange in which @a 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 + pair<_ForwardIterator, _ForwardIterator> + equal_range(_ForwardIterator __first, _ForwardIterator __last, + const _Tp& __val) + { + typedef typename iterator_traits<_ForwardIterator>::value_type + _ValueType; + typedef typename iterator_traits<_ForwardIterator>::difference_type + _DistanceType; + + // 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); + + _DistanceType __len = std::distance(__first, __last); + + while (__len > 0) + { + _DistanceType __half = __len >> 1; + _ForwardIterator __middle = __first; + std::advance(__middle, __half); + if (*__middle < __val) + { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + else if (__val < *__middle) + __len = __half; + else + { + _ForwardIterator __left = std::lower_bound(__first, __middle, + __val); + std::advance(__first, __len); + _ForwardIterator __right = std::upper_bound(++__middle, __first, + __val); + return pair<_ForwardIterator, _ForwardIterator>(__left, __right); + } + } + return pair<_ForwardIterator, _ForwardIterator>(__first, __first); + } + + /** + * @brief Finds the largest subrange in which @a 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 + pair<_ForwardIterator, _ForwardIterator> + equal_range(_ForwardIterator __first, _ForwardIterator __last, + const _Tp& __val, _Compare __comp) + { + typedef typename iterator_traits<_ForwardIterator>::value_type + _ValueType; + typedef typename iterator_traits<_ForwardIterator>::difference_type + _DistanceType; + + // 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); + + _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 if (__comp(__val, *__middle)) + __len = __half; + else + { + _ForwardIterator __left = std::lower_bound(__first, __middle, + __val, __comp); + std::advance(__first, __len); + _ForwardIterator __right = std::upper_bound(++__middle, __first, + __val, __comp); + return pair<_ForwardIterator, _ForwardIterator>(__left, __right); + } + } + return pair<_ForwardIterator, _ForwardIterator>(__first, __first); + } + + /** + * @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 @a val (or its equivalent) is in [@a first,@a last ]. + * + * Note that this does not actually return an iterator to @a 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); + 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 @a val (or its equivalent) is in [@a first,@a last ]. + * + * Note that this does not actually return an iterator to @a 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, __comp); + return __i != __last && !bool(__comp(__val, *__i)); + } + + // merge + + /// This is a helper function for the merge routines. + template + _BidirectionalIterator3 + __merge_backward(_BidirectionalIterator1 __first1, + _BidirectionalIterator1 __last1, + _BidirectionalIterator2 __first2, + _BidirectionalIterator2 __last2, + _BidirectionalIterator3 __result) + { + if (__first1 == __last1) + return std::copy_backward(__first2, __last2, __result); + if (__first2 == __last2) + return std::copy_backward(__first1, __last1, __result); + --__last1; + --__last2; + while (true) + { + if (*__last2 < *__last1) + { + *--__result = *__last1; + if (__first1 == __last1) + return std::copy_backward(__first2, ++__last2, __result); + --__last1; + } + else + { + *--__result = *__last2; + if (__first2 == __last2) + return std::copy_backward(__first1, ++__last1, __result); + --__last2; + } + } + } + + /// This is a helper function for the merge routines. + template + _BidirectionalIterator3 + __merge_backward(_BidirectionalIterator1 __first1, + _BidirectionalIterator1 __last1, + _BidirectionalIterator2 __first2, + _BidirectionalIterator2 __last2, + _BidirectionalIterator3 __result, + _Compare __comp) + { + if (__first1 == __last1) + return std::copy_backward(__first2, __last2, __result); + if (__first2 == __last2) + return std::copy_backward(__first1, __last1, __result); + --__last1; + --__last2; + while (true) + { + if (__comp(*__last2, *__last1)) + { + *--__result = *__last1; + if (__first1 == __last1) + return std::copy_backward(__first2, ++__last2, __result); + --__last1; + } + else + { + *--__result = *__last2; + if (__first2 == __last2) + return std::copy_backward(__first1, ++__last1, __result); + --__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) + { + __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer); + _GLIBCXX_MOVE_BACKWARD3(__first, __middle, __last); + return _GLIBCXX_MOVE3(__buffer, __buffer_end, __first); + } + else if (__len1 <= __buffer_size) + { + __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer); + _GLIBCXX_MOVE3(__middle, __last, __first); + return _GLIBCXX_MOVE_BACKWARD3(__buffer, __buffer_end, __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) + { + if (__len1 <= __len2 && __len1 <= __buffer_size) + { + _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer); + _GLIBCXX_STD_A::merge(_GLIBCXX_MAKE_MOVE_ITERATOR(__buffer), + _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer_end), + _GLIBCXX_MAKE_MOVE_ITERATOR(__middle), + _GLIBCXX_MAKE_MOVE_ITERATOR(__last), + __first); + } + else if (__len2 <= __buffer_size) + { + _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer); + std::__merge_backward(_GLIBCXX_MAKE_MOVE_ITERATOR(__first), + _GLIBCXX_MAKE_MOVE_ITERATOR(__middle), + _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer), + _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer_end), + __last); + } + 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); + __len22 = std::distance(__middle, __second_cut); + } + else + { + __len22 = __len2 / 2; + std::advance(__second_cut, __len22); + __first_cut = std::upper_bound(__first, __middle, + *__second_cut); + __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); + std::__merge_adaptive(__new_middle, __second_cut, __last, + __len1 - __len11, + __len2 - __len22, __buffer, __buffer_size); + } + } + + /// 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); + _GLIBCXX_STD_A::merge(_GLIBCXX_MAKE_MOVE_ITERATOR(__buffer), + _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer_end), + _GLIBCXX_MAKE_MOVE_ITERATOR(__middle), + _GLIBCXX_MAKE_MOVE_ITERATOR(__last), + __first, __comp); + } + else if (__len2 <= __buffer_size) + { + _Pointer __buffer_end = _GLIBCXX_MOVE3(__middle, __last, __buffer); + std::__merge_backward(_GLIBCXX_MAKE_MOVE_ITERATOR(__first), + _GLIBCXX_MAKE_MOVE_ITERATOR(__middle), + _GLIBCXX_MAKE_MOVE_ITERATOR(__buffer), + _GLIBCXX_MAKE_MOVE_ITERATOR(__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, + __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, + __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) + { + if (__len1 == 0 || __len2 == 0) + return; + if (__len1 + __len2 == 2) + { + if (*__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); + __len22 = std::distance(__middle, __second_cut); + } + else + { + __len22 = __len2 / 2; + std::advance(__second_cut, __len22); + __first_cut = std::upper_bound(__first, __middle, *__second_cut); + __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); + std::__merge_without_buffer(__new_middle, __second_cut, __last, + __len1 - __len11, __len2 - __len22); + } + + /// 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, + __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, + __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); + } + + /** + * @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 + void + inplace_merge(_BidirectionalIterator __first, + _BidirectionalIterator __middle, + _BidirectionalIterator __last) + { + typedef typename iterator_traits<_BidirectionalIterator>::value_type + _ValueType; + typedef typename iterator_traits<_BidirectionalIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< + _BidirectionalIterator>) + __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) + __glibcxx_requires_sorted(__first, __middle); + __glibcxx_requires_sorted(__middle, __last); + + if (__first == __middle || __middle == __last) + return; + + _DistanceType __len1 = std::distance(__first, __middle); + _DistanceType __len2 = std::distance(__middle, __last); + + _Temporary_buffer<_BidirectionalIterator, _ValueType> __buf(__first, + __last); + if (__buf.begin() == 0) + std::__merge_without_buffer(__first, __middle, __last, __len1, __len2); + else + std::__merge_adaptive(__first, __middle, __last, __len1, __len2, + __buf.begin(), _DistanceType(__buf.size())); + } + + /** + * @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 + 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; + + // concept requirements + __glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept< + _BidirectionalIterator>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType, _ValueType>) + __glibcxx_requires_sorted_pred(__first, __middle, __comp); + __glibcxx_requires_sorted_pred(__middle, __last, __comp); + + if (__first == __middle || __middle == __last) + return; + + const _DistanceType __len1 = std::distance(__first, __middle); + const _DistanceType __len2 = std::distance(__middle, __last); + + _Temporary_buffer<_BidirectionalIterator, _ValueType> __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); + } + + template + void + __merge_sort_loop(_RandomAccessIterator1 __first, + _RandomAccessIterator1 __last, + _RandomAccessIterator2 __result, + _Distance __step_size) + { + const _Distance __two_step = 2 * __step_size; + + while (__last - __first >= __two_step) + { + __result = _GLIBCXX_STD_A::merge( + _GLIBCXX_MAKE_MOVE_ITERATOR(__first), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __step_size), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __step_size), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __two_step), + __result); + __first += __two_step; + } + + __step_size = std::min(_Distance(__last - __first), __step_size); + _GLIBCXX_STD_A::merge(_GLIBCXX_MAKE_MOVE_ITERATOR(__first), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + + __step_size), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + + __step_size), + _GLIBCXX_MAKE_MOVE_ITERATOR(__last), + __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 = _GLIBCXX_STD_A::merge( + _GLIBCXX_MAKE_MOVE_ITERATOR(__first), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __step_size), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __step_size), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + __two_step), + __result, __comp); + __first += __two_step; + } + __step_size = std::min(_Distance(__last - __first), __step_size); + + _GLIBCXX_STD_A::merge(_GLIBCXX_MAKE_MOVE_ITERATOR(__first), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + + __step_size), + _GLIBCXX_MAKE_MOVE_ITERATOR(__first + + __step_size), + _GLIBCXX_MAKE_MOVE_ITERATOR(__last), + __result, __comp); + } + + template + void + __chunk_insertion_sort(_RandomAccessIterator __first, + _RandomAccessIterator __last, + _Distance __chunk_size) + { + while (__last - __first >= __chunk_size) + { + std::__insertion_sort(__first, __first + __chunk_size); + __first += __chunk_size; + } + std::__insertion_sort(__first, __last); + } + + 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) + { + 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); + + while (__step_size < __len) + { + std::__merge_sort_loop(__first, __last, __buffer, __step_size); + __step_size *= 2; + std::__merge_sort_loop(__buffer, __buffer_last, __first, __step_size); + __step_size *= 2; + } + } + + 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) + { + 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); + std::__stable_sort_adaptive(__middle, __last, + __buffer, __buffer_size); + } + else + { + std::__merge_sort_with_buffer(__first, __middle, __buffer); + std::__merge_sort_with_buffer(__middle, __last, __buffer); + } + std::__merge_adaptive(__first, __middle, __last, + _Distance(__middle - __first), + _Distance(__last - __middle), + __buffer, __buffer_size); + } + + 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) + { + if (__last - __first < 15) + { + std::__insertion_sort(__first, __last); + return; + } + _RandomAccessIterator __middle = __first + (__last - __first) / 2; + std::__inplace_stable_sort(__first, __middle); + std::__inplace_stable_sort(__middle, __last); + std::__merge_without_buffer(__first, __middle, __last, + __middle - __first, + __last - __middle); + } + + /// 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. + + /** + * @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 @a last2, false is returned. + */ + template + bool + includes(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set(__first1, __last1, __first2); + __glibcxx_requires_sorted_set(__first2, __last2, __first1); + + while (__first1 != __last1 && __first2 != __last2) + if (*__first2 < *__first1) + return false; + else if(*__first1 < *__first2) + ++__first1; + else + ++__first1, ++__first2; + + return __first2 == __last2; + } + + /** + * @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 @a + * last2, false is returned. + */ + template + bool + includes(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _Compare __comp) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType1, _ValueType2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); + __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __comp); + + while (__first1 != __last1 && __first2 != __last2) + if (__comp(*__first2, *__first1)) + return false; + else if(__comp(*__first1, *__first2)) + ++__first1; + else + ++__first1, ++__first2; + + return __first2 == __last2; + } + + // nth_element + // merge + // set_difference + // set_intersection + // set_union + // stable_sort + // set_symmetric_difference + // min_element + // max_element + + /** + * @brief Permute range into the next @a 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 @a 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 + 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); + + if (__first == __last) + return false; + _BidirectionalIterator __i = __first; + ++__i; + if (__i == __last) + return false; + __i = __last; + --__i; + + for(;;) + { + _BidirectionalIterator __ii = __i; + --__i; + if (*__i < *__ii) + { + _BidirectionalIterator __j = __last; + while (!(*__i < *--__j)) + {} + std::iter_swap(__i, __j); + std::reverse(__ii, __last); + return true; + } + if (__i == __first) + { + std::reverse(__first, __last); + return false; + } + } + } + + /** + * @brief Permute range into the next @a 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 + * @a dictionary sorted sequences ordered by @a 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 + 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); + + 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 (!bool(__comp(*__i, *--__j))) + {} + std::iter_swap(__i, __j); + std::reverse(__ii, __last); + return true; + } + if (__i == __first) + { + std::reverse(__first, __last); + return false; + } + } + } + + /** + * @brief Permute range into the previous @a 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 @a 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 + 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); + + if (__first == __last) + return false; + _BidirectionalIterator __i = __first; + ++__i; + if (__i == __last) + return false; + __i = __last; + --__i; + + for(;;) + { + _BidirectionalIterator __ii = __i; + --__i; + if (*__ii < *__i) + { + _BidirectionalIterator __j = __last; + while (!(*--__j < *__i)) + {} + std::iter_swap(__i, __j); + std::reverse(__ii, __last); + return true; + } + if (__i == __first) + { + std::reverse(__first, __last); + return false; + } + } + } + + /** + * @brief Permute range into the previous @a 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 + * @a dictionary sorted sequences ordered by @a 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 + 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); + + 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 (!bool(__comp(*--__j, *__i))) + {} + std::iter_swap(__i, __j); + std::reverse(__ii, __last); + return true; + } + if (__i == __first) + { + std::reverse(__first, __last); + return false; + } + } + } + + // replace + // replace_if + + /** + * @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 + _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); + + for (; __first != __last; ++__first, ++__result) + if (*__first == __old_value) + *__result = __new_value; + else + *__result = *__first; + return __result; + } + + /** + * @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 + _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); + + for (; __first != __last; ++__first, ++__result) + if (__pred(*__first)) + *__result = __new_value; + else + *__result = *__first; + return __result; + } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + /** + * @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; } + + /** + * @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 + _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); + + if (__first == __last) + return __last; + + _ForwardIterator __next = __first; + for (++__next; __next != __last; __first = __next, ++__next) + if (*__next < *__first) + return __next; + return __next; + } + + /** + * @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 + _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); + + 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 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 + 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_functor comparison functor@endlink. + * @return A pair(b, a) if b is smaller than a, pair(a, b) otherwise. + */ + template + inline pair + minmax(const _Tp& __a, const _Tp& __b, _Compare __comp) + { + return __comp(__b, __a) ? pair(__b, __a) + : pair(__a, __b); + } + + /** + * @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 + 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); + + _ForwardIterator __next = __first; + if (__first == __last + || ++__next == __last) + return std::make_pair(__first, __first); + + _ForwardIterator __min, __max; + if (*__next < *__first) + { + __min = __next; + __max = __first; + } + else + { + __min = __first; + __max = __next; + } + + __first = __next; + ++__first; + + while (__first != __last) + { + __next = __first; + if (++__next == __last) + { + if (*__first < *__min) + __min = __first; + else if (!(*__first < *__max)) + __max = __first; + break; + } + + if (*__next < *__first) + { + if (*__next < *__min) + __min = __next; + if (!(*__first < *__max)) + __max = __first; + } + else + { + if (*__first < *__min) + __min = __first; + if (!(*__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. + * @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 + 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); + + _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); + } + + // N2722 + DR 915. + template + inline _Tp + min(initializer_list<_Tp> __l) + { return *std::min_element(__l.begin(), __l.end()); } + + template + inline _Tp + min(initializer_list<_Tp> __l, _Compare __comp) + { return *std::min_element(__l.begin(), __l.end(), __comp); } + + template + inline _Tp + max(initializer_list<_Tp> __l) + { return *std::max_element(__l.begin(), __l.end()); } + + template + inline _Tp + max(initializer_list<_Tp> __l, _Compare __comp) + { return *std::max_element(__l.begin(), __l.end(), __comp); } + + template + 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 + 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); + } + + /** + * @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. + * @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 + bool + is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, + _ForwardIterator2 __first2) + { + // Efficiently compare identical prefixes: O(N) if sequences + // have the same elements in the same order. + for (; __first1 != __last1; ++__first1, ++__first2) + if (!(*__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 != _GLIBCXX_STD_A::find(__first1, __scan, *__scan)) + continue; // We've seen this one before. + + auto __matches = std::count(__first2, __last2, *__scan); + if (0 == __matches + || std::count(__scan, __last1, *__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. + * @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 + 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 (!bool(__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) + { + using std::placeholders::_1; + + if (__scan != _GLIBCXX_STD_A::find_if(__first1, __scan, + std::bind(__pred, _1, *__scan))) + continue; // We've seen this one before. + + auto __matches = std::count_if(__first2, __last2, + std::bind(__pred, _1, *__scan)); + if (0 == __matches + || std::count_if(__scan, __last1, + std::bind(__pred, _1, *__scan)) != __matches) + return false; + } + return true; + } + +#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 + +#endif // __GXX_EXPERIMENTAL_CXX0X__ + +_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(__first, __last, __val, + std::__iterator_category(__first)); + } + + /** + * @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, __pred, + std::__iterator_category(__first)); + } + + /** + * @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 + _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); + if (__first == __last) + return __last; + _ForwardIterator __next = __first; + while(++__next != __last) + { + if (*__first == *__next) + return __first; + __first = __next; + } + return __last; + } + + /** + * @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 + _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); + if (__first == __last) + return __last; + _ForwardIterator __next = __first; + while(++__next != __last) + { + if (__binary_pred(*__first, *__next)) + return __first; + __first = __next; + } + return __last; + } + + /** + * @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 + 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); + typename iterator_traits<_InputIterator>::difference_type __n = 0; + for (; __first != __last; ++__first) + if (*__first == __value) + ++__n; + return __n; + } + + /** + * @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 + 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); + typename iterator_traits<_InputIterator>::difference_type __n = 0; + for (; __first != __last; ++__first) + if (__pred(*__first)) + ++__n; + return __n; + } + + /** + * @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 + _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); + + // 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 _GLIBCXX_STD_A::find(__first1, __last1, *__first2); + + // General case. + _ForwardIterator2 __p; + _ForwardIterator1 __current = __first1; + + for (;;) + { + __first1 = _GLIBCXX_STD_A::find(__first1, __last1, *__first2); + if (__first1 == __last1) + return __last1; + + __p = __p1; + __current = __first1; + if (++__current == __last1) + return __last1; + + while (*__current == *__p) + { + if (++__p == __last2) + return __first1; + if (++__current == __last1) + return __last1; + } + ++__first1; + } + return __first1; + } + + /** + * @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 + _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); + + // Test for empty ranges + if (__first1 == __last1 || __first2 == __last2) + return __first1; + + // Test for a pattern of length 1. + _ForwardIterator2 __p1(__first2); + if (++__p1 == __last2) + { + while (__first1 != __last1 + && !bool(__predicate(*__first1, *__first2))) + ++__first1; + return __first1; + } + + // General case. + _ForwardIterator2 __p; + _ForwardIterator1 __current = __first1; + + for (;;) + { + while (__first1 != __last1 + && !bool(__predicate(*__first1, *__first2))) + ++__first1; + 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; + } + + + /** + * @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 + _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); + + if (__count <= 0) + return __first; + if (__count == 1) + return _GLIBCXX_STD_A::find(__first, __last, __val); + return std::__search_n(__first, __last, __count, __val, + std::__iterator_category(__first)); + } + + + /** + * @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 + _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); + + if (__count <= 0) + return __first; + if (__count == 1) + { + while (__first != __last && !bool(__binary_pred(*__first, __val))) + ++__first; + return __first; + } + return std::__search_n(__first, __last, __count, __val, __binary_pred, + std::__iterator_category(__first)); + } + + + /** + * @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 (; __n > 0; --__n, ++__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, + 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, __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) + std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1))); + } + + /** + * @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, +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + _RandomNumberGenerator&& __rand) +#else + _RandomNumberGenerator& __rand) +#endif + { + // 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) + std::iter_swap(__i, __first + __rand((__i - __first) + 1)); + } + + + /** + * @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 @p i and @j are iterators in the range + * @p [first,middle) such that @i precedes @j and @k is an iterator in + * the range @p [middle,last) then @p *j<*i and @p *k<*i are both false. + */ + template + inline void + partial_sort(_RandomAccessIterator __first, + _RandomAccessIterator __middle, + _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_valid_range(__first, __middle); + __glibcxx_requires_valid_range(__middle, __last); + + std::__heap_select(__first, __middle, __last); + std::sort_heap(__first, __middle); + } + + /** + * @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 @p i and @j are iterators in the range + * @p [first,middle) such that @i precedes @j and @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) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + + // concept requirements + __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType, _ValueType>) + __glibcxx_requires_valid_range(__first, __middle); + __glibcxx_requires_valid_range(__middle, __last); + + std::__heap_select(__first, __middle, __last, __comp); + std::sort_heap(__first, __middle, __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. + * whole sequence been sorted. The elements either side of @p *nth are + * not completely sorted, but for any iterator @i in the range + * @p [first,nth) and any iterator @j in the range @p [nth,last) it + * holds that @p *j<*i is false. + */ + template + inline void + nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, + _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_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); + } + + /** + * @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 @i in the range + * @p [first,nth) and any iterator @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) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + + // concept requirements + __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType, _ValueType>) + __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, __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 @p *(i+1)<*i is false for each iterator @p 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) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + + // concept requirements + __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>) + __glibcxx_function_requires(_LessThanComparableConcept<_ValueType>) + __glibcxx_requires_valid_range(__first, __last); + + if (__first != __last) + { + std::__introsort_loop(__first, __last, + std::__lg(__last - __first) * 2); + std::__final_insertion_sort(__first, __last); + } + } + + /** + * @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 @p 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) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + + // concept requirements + __glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, + _ValueType>) + __glibcxx_requires_valid_range(__first, __last); + + if (__first != __last) + { + std::__introsort_loop(__first, __last, + std::__lg(__last - __first) * 2, __comp); + std::__final_insertion_sort(__first, __last, __comp); + } + } + + /** + * @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 @a val. + * + * Merges the ranges [first1,last1) and [first2,last2) into the sorted range + * [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 + _OutputIterator + merge(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set(__first1, __last1, __first2); + __glibcxx_requires_sorted_set(__first2, __last2, __first1); + + while (__first1 != __last1 && __first2 != __last2) + { + if (*__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. + * @param comp A functor to use for comparisons. + * @return An iterator pointing to the first element "not less + * than" @a val. + * + * Merges the ranges [first1,last1) and [first2,last2) into the sorted range + * [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 + _OutputIterator + merge(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result, _Compare __comp) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); + __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __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 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 @p *(i+1)<*i is false for each iterator @p i in the range + * @p [first,last-1). + * + * 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) + { + 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); + + _Temporary_buffer<_RandomAccessIterator, _ValueType> __buf(__first, + __last); + if (__buf.begin() == 0) + std::__inplace_stable_sort(__first, __last); + else + std::__stable_sort_adaptive(__first, __last, __buf.begin(), + _DistanceType(__buf.size())); + } + + /** + * @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 @p comp(*(i+1),*i) is false for each iterator @p i in the + * range @p [first,last-1). + * + * 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) + { + 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(_BinaryPredicateConcept<_Compare, + _ValueType, + _ValueType>) + __glibcxx_requires_valid_range(__first, __last); + + _Temporary_buffer<_RandomAccessIterator, _ValueType> __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 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 + _OutputIterator + set_union(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set(__first1, __last1, __first2); + __glibcxx_requires_sorted_set(__first2, __last2, __first1); + + while (__first1 != __last1 && __first2 != __last2) + { + if (*__first1 < *__first2) + { + *__result = *__first1; + ++__first1; + } + else if (*__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 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 @a comp, that element is copied and the iterator advanced. + * If an equivalent element according to @a 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 + _OutputIterator + set_union(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result, _Compare __comp) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType1, _ValueType2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); + __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __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 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 + _OutputIterator + set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set(__first1, __last1, __first2); + __glibcxx_requires_sorted_set(__first2, __last2, __first1); + + while (__first1 != __last1 && __first2 != __last2) + if (*__first1 < *__first2) + ++__first1; + else if (*__first2 < *__first1) + ++__first2; + else + { + *__result = *__first1; + ++__first1; + ++__first2; + ++__result; + } + return __result; + } + + /** + * @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 @a comp, that iterator advances. If an element is + * contained in both ranges according to @a comp, the element from the + * first range is copied and both ranges advance. The output range may not + * overlap either input range. + */ + template + _OutputIterator + set_intersection(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result, _Compare __comp) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType1, _ValueType2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); + __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __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 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 + _OutputIterator + set_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set(__first1, __last1, __first2); + __glibcxx_requires_sorted_set(__first2, __last2, __first1); + + while (__first1 != __last1 && __first2 != __last2) + if (*__first1 < *__first2) + { + *__result = *__first1; + ++__first1; + ++__result; + } + else if (*__first2 < *__first1) + ++__first2; + else + { + ++__first1; + ++__first2; + } + return std::copy(__first1, __last1, __result); + } + + /** + * @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 @a 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 @a comp, no + * elements are copied and both ranges advance. The output range may not + * overlap either input range. + */ + template + _OutputIterator + set_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result, _Compare __comp) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType1, _ValueType2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); + __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __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 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 + _OutputIterator + set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType1, _ValueType2>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set(__first1, __last1, __first2); + __glibcxx_requires_sorted_set(__first2, __last2, __first1); + + while (__first1 != __last1 && __first2 != __last2) + if (*__first1 < *__first2) + { + *__result = *__first1; + ++__first1; + ++__result; + } + else if (*__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 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 @a comp, that element is copied and the + * iterator advances. If an element is contained in both ranges according + * to @a comp, no elements are copied and both ranges advance. The output + * range may not overlap either input range. + */ + template + _OutputIterator + set_symmetric_difference(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _InputIterator2 __last2, + _OutputIterator __result, + _Compare __comp) + { + typedef typename iterator_traits<_InputIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_InputIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>) + __glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType1>) + __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, + _ValueType2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType1, _ValueType2>) + __glibcxx_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType2, _ValueType1>) + __glibcxx_requires_sorted_set_pred(__first1, __last1, __first2, __comp); + __glibcxx_requires_sorted_set_pred(__first2, __last2, __first1, __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 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 + _ForwardIterator + 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); + + if (__first == __last) + return __first; + _ForwardIterator __result = __first; + while (++__first != __last) + if (*__first < *__result) + __result = __first; + return __result; + } + + /** + * @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 + _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); + + if (__first == __last) + return __first; + _ForwardIterator __result = __first; + while (++__first != __last) + if (__comp(*__first, *__result)) + __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 + _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); + + if (__first == __last) + return __first; + _ForwardIterator __result = __first; + while (++__first != __last) + if (*__result < *__first) + __result = __first; + return __result; + } + + /** + * @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 + _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); + + if (__first == __last) return __first; + _ForwardIterator __result = __first; + while (++__first != __last) + if (__comp(*__result, *__first)) + __result = __first; + return __result; + } + +_GLIBCXX_END_NAMESPACE_ALGO +} // namespace std + +#endif /* _STL_ALGO_H */ diff --git a/GCC_XML/Support/GCC/4.6/bits/stl_algobase.h b/GCC_XML/Support/GCC/4.6/bits/stl_algobase.h new file mode 100644 index 0000000..001ac77 --- /dev/null +++ b/GCC_XML/Support/GCC/4.6/bits/stl_algobase.h @@ -0,0 +1,1209 @@ +// Core algorithmic facilities -*- C++ -*- + +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +// 2011 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 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // For std::swap and _GLIBCXX_MOVE + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // 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); + } + }; + + /** + * @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) + { + typedef typename iterator_traits<_ForwardIterator1>::value_type + _ValueType1; + typedef typename iterator_traits<_ForwardIterator2>::value_type + _ValueType2; + + // concept requirements + __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< + _ForwardIterator1>) + __glibcxx_function_requires(_Mutable_ForwardIteratorConcept< + _ForwardIterator2>) + __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); + } + + /** + * @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 + 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 + 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 + 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 + 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; + } + }; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + 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 + + 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; + } + }; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + 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 + + template + struct __copy_move<_IsMove, true, random_access_iterator_tag> + { + template + static _Tp* + __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result) + { + 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)); + } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + /** + * @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 +#define _GLIBCXX_MOVE3(_Tp, _Up, _Vp) std::copy(_Tp, _Up, _Vp) +#endif + + template + struct __copy_move_backward + { + template + static _BI2 + __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result) + { + while (__first != __last) + *--__result = *--__last; + return __result; + } + }; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + 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 + + 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; + } + }; + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + 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 + + 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) + { + 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)); + } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + /** + * @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 +#define _GLIBCXX_MOVE_BACKWARD3(_Tp, _Up, _Vp) std::copy_backward(_Tp, _Up, _Vp) +#endif + + 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; + __builtin_memset(__first, static_cast(__tmp), + __last - __first); + } + + /** + * @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 (;__n > 0; --__n, ++__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 (; __n > 0; --__n, ++__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) + { + return !__builtin_memcmp(__first1, __first2, sizeof(_Tp) + * (__last1 - __first1)); + } + }; + + 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<_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 + 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) + { + 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 (*__first1 < *__first2) + return true; + if (*__first2 < *__first1) + return false; + } + return __first1 == __last1 && __first2 != __last2; + } + + 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; + const int __result = __builtin_memcmp(__first1, __first2, + std::min(__len1, __len2)); + return __result != 0 ? __result < 0 : __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); + } + + /** + * @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 + _ForwardIterator + lower_bound(_ForwardIterator __first, _ForwardIterator __last, + const _Tp& __val) + { + typedef typename iterator_traits<_ForwardIterator>::value_type + _ValueType; + typedef typename iterator_traits<_ForwardIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>) + __glibcxx_function_requires(_LessThanOpConcept<_ValueType, _Tp>) + __glibcxx_requires_partitioned_lower(__first, __last, __val); + + _DistanceType __len = std::distance(__first, __last); + + while (__len > 0) + { + _DistanceType __half = __len >> 1; + _ForwardIterator __middle = __first; + std::advance(__middle, __half); + if (*__middle < __val) + { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + else + __len = __half; + } + return __first; + } + + /// This is a helper function for the sort routines and for random.tcc. + // Precondition: __n > 0. + template + inline _Size + __lg(_Size __n) + { + _Size __k; + for (__k = 0; __n != 0; __n >>= 1) + ++__k; + return __k - 1; + } + + inline int + __lg(int __n) + { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } + + inline long + __lg(long __n) + { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } + + inline long long + __lg(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; + } + + /** + * @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) + { + // concept requirements + typedef typename iterator_traits<_II1>::value_type _ValueType1; + typedef typename iterator_traits<_II2>::value_type _ValueType2; + __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 + bool + lexicographical_compare(_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; + + // concept requirements + __glibcxx_function_requires(_InputIteratorConcept<_II1>) + __glibcxx_function_requires(_InputIteratorConcept<_II2>) + __glibcxx_requires_valid_range(__first1, __last1); + __glibcxx_requires_valid_range(__first2, __last2); + + __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; + } + + /** + * @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 + 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); + + while (__first1 != __last1 && *__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 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 + 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); + + while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2))) + { + ++__first1; + ++__first2; + } + return pair<_InputIterator1, _InputIterator2>(__first1, __first2); + } + +_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 +# include +#endif + +#endif diff --git a/GCC_XML/Support/GCC/4.6/complex b/GCC_XML/Support/GCC/4.6/complex new file mode 100644 index 0000000..71ab75a --- /dev/null +++ b/GCC_XML/Support/GCC/4.6/complex @@ -0,0 +1,1894 @@ +// The template and inlines for the -*- C++ -*- complex number classes. + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +// 2006, 2007, 2008, 2009, 2010 +// 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/complex + * This is a Standard C++ Library header. + */ + +// +// ISO C++ 14882: 26.2 Complex Numbers +// Note: this is not a conforming implementation. +// Initially implemented by Ulrich Drepper +// Improved by Gabriel Dos Reis +// + +#ifndef _GLIBCXX_COMPLEX +#define _GLIBCXX_COMPLEX 1 + +#pragma GCC system_header + +#include +#include +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + /** + * @defgroup complex_numbers Complex Numbers + * @ingroup numerics + * + * Classes and functions for complex numbers. + * @{ + */ + + // Forward declarations. + template class complex; + template<> class complex; + template<> class complex; + template<> class complex; + + /// Return magnitude of @a z. + template _Tp abs(const complex<_Tp>&); + /// Return phase angle of @a z. + template _Tp arg(const complex<_Tp>&); + /// Return @a z magnitude squared. + template _Tp norm(const complex<_Tp>&); + + /// Return complex conjugate of @a z. + template complex<_Tp> conj(const complex<_Tp>&); + /// Return complex with magnitude @a rho and angle @a theta. + template complex<_Tp> polar(const _Tp&, const _Tp& = 0); + + // Transcendentals: + /// Return complex cosine of @a z. + template complex<_Tp> cos(const complex<_Tp>&); + /// Return complex hyperbolic cosine of @a z. + template complex<_Tp> cosh(const complex<_Tp>&); + /// Return complex base e exponential of @a z. + template complex<_Tp> exp(const complex<_Tp>&); + /// Return complex natural logarithm of @a z. + template complex<_Tp> log(const complex<_Tp>&); + /// Return complex base 10 logarithm of @a z. + template complex<_Tp> log10(const complex<_Tp>&); +#ifndef __GXX_EXPERIMENTAL_CXX0X__ + // DR 844. + /// Return @a x to the @a y'th power. + template complex<_Tp> pow(const complex<_Tp>&, int); +#endif + /// Return @a x to the @a y'th power. + template complex<_Tp> pow(const complex<_Tp>&, const _Tp&); + /// Return @a x to the @a y'th power. + template complex<_Tp> pow(const complex<_Tp>&, + const complex<_Tp>&); + /// Return @a x to the @a y'th power. + template complex<_Tp> pow(const _Tp&, const complex<_Tp>&); + /// Return complex sine of @a z. + template complex<_Tp> sin(const complex<_Tp>&); + /// Return complex hyperbolic sine of @a z. + template complex<_Tp> sinh(const complex<_Tp>&); + /// Return complex square root of @a z. + template complex<_Tp> sqrt(const complex<_Tp>&); + /// Return complex tangent of @a z. + template complex<_Tp> tan(const complex<_Tp>&); + /// Return complex hyperbolic tangent of @a z. + template complex<_Tp> tanh(const complex<_Tp>&); + + + // 26.2.2 Primary template class complex + /** + * Template to represent complex numbers. + * + * Specializations for float, double, and long double are part of the + * library. Results with any other type are not guaranteed. + * + * @param Tp Type of real and imaginary values. + */ + template + struct complex + { + /// Value typedef. + typedef _Tp value_type; + + /// Default constructor. First parameter is x, second parameter is y. + /// Unspecified parameters default to 0. + _GLIBCXX_CONSTEXPR complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp()) + : _M_real(__r), _M_imag(__i) { } + + // Lets the compiler synthesize the copy constructor + // complex (const complex<_Tp>&); + /// Copy constructor. + template + _GLIBCXX_CONSTEXPR complex(const complex<_Up>& __z) + : _M_real(__z.real()), _M_imag(__z.imag()) { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 387. std::complex over-encapsulated. + constexpr _Tp + real() const { return _M_real; } + + constexpr _Tp + imag() const { return _M_imag; } +#else + /// Return real part of complex number. + _Tp& + real() { return _M_real; } + + /// Return real part of complex number. + const _Tp& + real() const { return _M_real; } + + /// Return imaginary part of complex number. + _Tp& + imag() { return _M_imag; } + + /// Return imaginary part of complex number. + const _Tp& + imag() const { return _M_imag; } +#endif + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 387. std::complex over-encapsulated. + void + real(_Tp __val) { _M_real = __val; } + + void + imag(_Tp __val) { _M_imag = __val; } + + /// Assign this complex number to scalar @a t. + complex<_Tp>& operator=(const _Tp&); + + /// Add @a t to this complex number. + // 26.2.5/1 + complex<_Tp>& + operator+=(const _Tp& __t) + { + _M_real += __t; + return *this; + } + + /// Subtract @a t from this complex number. + // 26.2.5/3 + complex<_Tp>& + operator-=(const _Tp& __t) + { + _M_real -= __t; + return *this; + } + + /// Multiply this complex number by @a t. + complex<_Tp>& operator*=(const _Tp&); + /// Divide this complex number by @a t. + complex<_Tp>& operator/=(const _Tp&); + + // Lets the compiler synthesize the + // copy and assignment operator + // complex<_Tp>& operator= (const complex<_Tp>&); + /// Assign this complex number to complex @a z. + template + complex<_Tp>& operator=(const complex<_Up>&); + /// Add @a z to this complex number. + template + complex<_Tp>& operator+=(const complex<_Up>&); + /// Subtract @a z from this complex number. + template + complex<_Tp>& operator-=(const complex<_Up>&); + /// Multiply this complex number by @a z. + template + complex<_Tp>& operator*=(const complex<_Up>&); + /// Divide this complex number by @a z. + template + complex<_Tp>& operator/=(const complex<_Up>&); + + _GLIBCXX_USE_CONSTEXPR complex __rep() const + { return *this; } + + private: + _Tp _M_real; + _Tp _M_imag; + }; + + template + complex<_Tp>& + complex<_Tp>::operator=(const _Tp& __t) + { + _M_real = __t; + _M_imag = _Tp(); + return *this; + } + + // 26.2.5/5 + template + complex<_Tp>& + complex<_Tp>::operator*=(const _Tp& __t) + { + _M_real *= __t; + _M_imag *= __t; + return *this; + } + + // 26.2.5/7 + template + complex<_Tp>& + complex<_Tp>::operator/=(const _Tp& __t) + { + _M_real /= __t; + _M_imag /= __t; + return *this; + } + + template + template + complex<_Tp>& + complex<_Tp>::operator=(const complex<_Up>& __z) + { + _M_real = __z.real(); + _M_imag = __z.imag(); + return *this; + } + + // 26.2.5/9 + template + template + complex<_Tp>& + complex<_Tp>::operator+=(const complex<_Up>& __z) + { + _M_real += __z.real(); + _M_imag += __z.imag(); + return *this; + } + + // 26.2.5/11 + template + template + complex<_Tp>& + complex<_Tp>::operator-=(const complex<_Up>& __z) + { + _M_real -= __z.real(); + _M_imag -= __z.imag(); + return *this; + } + + // 26.2.5/13 + // XXX: This is a grammar school implementation. + template + template + complex<_Tp>& + complex<_Tp>::operator*=(const complex<_Up>& __z) + { + const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag(); + _M_imag = _M_real * __z.imag() + _M_imag * __z.real(); + _M_real = __r; + return *this; + } + + // 26.2.5/15 + // XXX: This is a grammar school implementation. + template + template + complex<_Tp>& + complex<_Tp>::operator/=(const complex<_Up>& __z) + { + const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag(); + const _Tp __n = std::norm(__z); + _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n; + _M_real = __r / __n; + return *this; + } + + // Operators: + //@{ + /// Return new complex value @a x plus @a y. + template + inline complex<_Tp> + operator+(const complex<_Tp>& __x, const complex<_Tp>& __y) + { + complex<_Tp> __r = __x; + __r += __y; + return __r; + } + + template + inline complex<_Tp> + operator+(const complex<_Tp>& __x, const _Tp& __y) + { + complex<_Tp> __r = __x; + __r += __y; + return __r; + } + + template + inline complex<_Tp> + operator+(const _Tp& __x, const complex<_Tp>& __y) + { + complex<_Tp> __r = __y; + __r += __x; + return __r; + } + //@} + + //@{ + /// Return new complex value @a x minus @a y. + template + inline complex<_Tp> + operator-(const complex<_Tp>& __x, const complex<_Tp>& __y) + { + complex<_Tp> __r = __x; + __r -= __y; + return __r; + } + + template + inline complex<_Tp> + operator-(const complex<_Tp>& __x, const _Tp& __y) + { + complex<_Tp> __r = __x; + __r -= __y; + return __r; + } + + template + inline complex<_Tp> + operator-(const _Tp& __x, const complex<_Tp>& __y) + { + complex<_Tp> __r(__x, -__y.imag()); + __r -= __y.real(); + return __r; + } + //@} + + //@{ + /// Return new complex value @a x times @a y. + template + inline complex<_Tp> + operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) + { + complex<_Tp> __r = __x; + __r *= __y; + return __r; + } + + template + inline complex<_Tp> + operator*(const complex<_Tp>& __x, const _Tp& __y) + { + complex<_Tp> __r = __x; + __r *= __y; + return __r; + } + + template + inline complex<_Tp> + operator*(const _Tp& __x, const complex<_Tp>& __y) + { + complex<_Tp> __r = __y; + __r *= __x; + return __r; + } + //@} + + //@{ + /// Return new complex value @a x divided by @a y. + template + inline complex<_Tp> + operator/(const complex<_Tp>& __x, const complex<_Tp>& __y) + { + complex<_Tp> __r = __x; + __r /= __y; + return __r; + } + + template + inline complex<_Tp> + operator/(const complex<_Tp>& __x, const _Tp& __y) + { + complex<_Tp> __r = __x; + __r /= __y; + return __r; + } + + template + inline complex<_Tp> + operator/(const _Tp& __x, const complex<_Tp>& __y) + { + complex<_Tp> __r = __x; + __r /= __y; + return __r; + } + //@} + + /// Return @a x. + template + inline complex<_Tp> + operator+(const complex<_Tp>& __x) + { return __x; } + + /// Return complex negation of @a x. + template + inline complex<_Tp> + operator-(const complex<_Tp>& __x) + { return complex<_Tp>(-__x.real(), -__x.imag()); } + + //@{ + /// Return true if @a x is equal to @a y. + template + inline _GLIBCXX_CONSTEXPR bool + operator==(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __x.real() == __y.real() && __x.imag() == __y.imag(); } + + template + inline _GLIBCXX_CONSTEXPR bool + operator==(const complex<_Tp>& __x, const _Tp& __y) + { return __x.real() == __y && __x.imag() == _Tp(); } + + template + inline _GLIBCXX_CONSTEXPR bool + operator==(const _Tp& __x, const complex<_Tp>& __y) + { return __x == __y.real() && _Tp() == __y.imag(); } + //@} + + //@{ + /// Return false if @a x is equal to @a y. + template + inline _GLIBCXX_CONSTEXPR bool + operator!=(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __x.real() != __y.real() || __x.imag() != __y.imag(); } + + template + inline _GLIBCXX_CONSTEXPR bool + operator!=(const complex<_Tp>& __x, const _Tp& __y) + { return __x.real() != __y || __x.imag() != _Tp(); } + + template + inline _GLIBCXX_CONSTEXPR bool + operator!=(const _Tp& __x, const complex<_Tp>& __y) + { return __x != __y.real() || _Tp() != __y.imag(); } + //@} + + /// Extraction operator for complex values. + template + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) + { + _Tp __re_x, __im_x; + _CharT __ch; + __is >> __ch; + if (__ch == '(') + { + __is >> __re_x >> __ch; + if (__ch == ',') + { + __is >> __im_x >> __ch; + if (__ch == ')') + __x = complex<_Tp>(__re_x, __im_x); + else + __is.setstate(ios_base::failbit); + } + else if (__ch == ')') + __x = __re_x; + else + __is.setstate(ios_base::failbit); + } + else + { + __is.putback(__ch); + __is >> __re_x; + __x = __re_x; + } + return __is; + } + + /// Insertion operator for complex values. + template + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) + { + basic_ostringstream<_CharT, _Traits> __s; + __s.flags(__os.flags()); + __s.imbue(__os.getloc()); + __s.precision(__os.precision()); + __s << '(' << __x.real() << ',' << __x.imag() << ')'; + return __os << __s.str(); + } + + // Values +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + inline constexpr _Tp + real(const complex<_Tp>& __z) + { return __z.real(); } + + template + inline constexpr _Tp + imag(const complex<_Tp>& __z) + { return __z.imag(); } +#else + template + inline _Tp& + real(complex<_Tp>& __z) + { return __z.real(); } + + template + inline const _Tp& + real(const complex<_Tp>& __z) + { return __z.real(); } + + template + inline _Tp& + imag(complex<_Tp>& __z) + { return __z.imag(); } + + template + inline const _Tp& + imag(const complex<_Tp>& __z) + { return __z.imag(); } +#endif + + // 26.2.7/3 abs(__z): Returns the magnitude of __z. + template + inline _Tp + __complex_abs(const complex<_Tp>& __z) + { + _Tp __x = __z.real(); + _Tp __y = __z.imag(); + const _Tp __s = std::max(abs(__x), abs(__y)); + if (__s == _Tp()) // well ... + return __s; + __x /= __s; + __y /= __s; + return __s * sqrt(__x * __x + __y * __y); + } + +#if _GLIBCXX_USE_C99_COMPLEX + inline float + __complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); } + + inline double + __complex_abs(__complex__ double __z) { return __builtin_cabs(__z); } + + inline long double + __complex_abs(const __complex__ long double& __z) + { return __builtin_cabsl(__z); } + + template + inline _Tp + abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); } +#else + template + inline _Tp + abs(const complex<_Tp>& __z) { return __complex_abs(__z); } +#endif + + + // 26.2.7/4: arg(__z): Returns the phase angle of __z. + template + inline _Tp + __complex_arg(const complex<_Tp>& __z) + { return atan2(__z.imag(), __z.real()); } + +#if _GLIBCXX_USE_C99_COMPLEX + inline float + __complex_arg(__complex__ float __z) { return __builtin_cargf(__z); } + + inline double + __complex_arg(__complex__ double __z) { return __builtin_carg(__z); } + + inline long double + __complex_arg(const __complex__ long double& __z) + { return __builtin_cargl(__z); } + + template + inline _Tp + arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); } +#else + template + inline _Tp + arg(const complex<_Tp>& __z) { return __complex_arg(__z); } +#endif + + // 26.2.7/5: norm(__z) returns the squared magnitude of __z. + // As defined, norm() is -not- a norm is the common mathematical + // sens used in numerics. The helper class _Norm_helper<> tries to + // distinguish between builtin floating point and the rest, so as + // to deliver an answer as close as possible to the real value. + template + struct _Norm_helper + { + template + static inline _Tp _S_do_it(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return __x * __x + __y * __y; + } + }; + + template<> + struct _Norm_helper + { + template + static inline _Tp _S_do_it(const complex<_Tp>& __z) + { + _Tp __res = std::abs(__z); + return __res * __res; + } + }; + + template + inline _Tp + norm(const complex<_Tp>& __z) + { + return _Norm_helper<__is_floating<_Tp>::__value + && !_GLIBCXX_FAST_MATH>::_S_do_it(__z); + } + + template + inline complex<_Tp> + polar(const _Tp& __rho, const _Tp& __theta) + { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } + + template + inline complex<_Tp> + conj(const complex<_Tp>& __z) + { return complex<_Tp>(__z.real(), -__z.imag()); } + + // Transcendentals + + // 26.2.8/1 cos(__z): Returns the cosine of __z. + template + inline complex<_Tp> + __complex_cos(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y)); + } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_cos(__complex__ float __z) { return __builtin_ccosf(__z); } + + inline __complex__ double + __complex_cos(__complex__ double __z) { return __builtin_ccos(__z); } + + inline __complex__ long double + __complex_cos(const __complex__ long double& __z) + { return __builtin_ccosl(__z); } + + template + inline complex<_Tp> + cos(const complex<_Tp>& __z) { return __complex_cos(__z.__rep()); } +#else + template + inline complex<_Tp> + cos(const complex<_Tp>& __z) { return __complex_cos(__z); } +#endif + + // 26.2.8/2 cosh(__z): Returns the hyperbolic cosine of __z. + template + inline complex<_Tp> + __complex_cosh(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y)); + } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_cosh(__complex__ float __z) { return __builtin_ccoshf(__z); } + + inline __complex__ double + __complex_cosh(__complex__ double __z) { return __builtin_ccosh(__z); } + + inline __complex__ long double + __complex_cosh(const __complex__ long double& __z) + { return __builtin_ccoshl(__z); } + + template + inline complex<_Tp> + cosh(const complex<_Tp>& __z) { return __complex_cosh(__z.__rep()); } +#else + template + inline complex<_Tp> + cosh(const complex<_Tp>& __z) { return __complex_cosh(__z); } +#endif + + // 26.2.8/3 exp(__z): Returns the complex base e exponential of x + template + inline complex<_Tp> + __complex_exp(const complex<_Tp>& __z) + { return std::polar(exp(__z.real()), __z.imag()); } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_exp(__complex__ float __z) { return __builtin_cexpf(__z); } + + inline __complex__ double + __complex_exp(__complex__ double __z) { return __builtin_cexp(__z); } + + inline __complex__ long double + __complex_exp(const __complex__ long double& __z) + { return __builtin_cexpl(__z); } + + template + inline complex<_Tp> + exp(const complex<_Tp>& __z) { return __complex_exp(__z.__rep()); } +#else + template + inline complex<_Tp> + exp(const complex<_Tp>& __z) { return __complex_exp(__z); } +#endif + + // 26.2.8/5 log(__z): Returns the natural complex logarithm of __z. + // The branch cut is along the negative axis. + template + inline complex<_Tp> + __complex_log(const complex<_Tp>& __z) + { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_log(__complex__ float __z) { return __builtin_clogf(__z); } + + inline __complex__ double + __complex_log(__complex__ double __z) { return __builtin_clog(__z); } + + inline __complex__ long double + __complex_log(const __complex__ long double& __z) + { return __builtin_clogl(__z); } + + template + inline complex<_Tp> + log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); } +#else + template + inline complex<_Tp> + log(const complex<_Tp>& __z) { return __complex_log(__z); } +#endif + + template + inline complex<_Tp> + log10(const complex<_Tp>& __z) + { return std::log(__z) / log(_Tp(10.0)); } + + // 26.2.8/10 sin(__z): Returns the sine of __z. + template + inline complex<_Tp> + __complex_sin(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y)); + } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_sin(__complex__ float __z) { return __builtin_csinf(__z); } + + inline __complex__ double + __complex_sin(__complex__ double __z) { return __builtin_csin(__z); } + + inline __complex__ long double + __complex_sin(const __complex__ long double& __z) + { return __builtin_csinl(__z); } + + template + inline complex<_Tp> + sin(const complex<_Tp>& __z) { return __complex_sin(__z.__rep()); } +#else + template + inline complex<_Tp> + sin(const complex<_Tp>& __z) { return __complex_sin(__z); } +#endif + + // 26.2.8/11 sinh(__z): Returns the hyperbolic sine of __z. + template + inline complex<_Tp> + __complex_sinh(const complex<_Tp>& __z) + { + const _Tp __x = __z.real(); + const _Tp __y = __z.imag(); + return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y)); + } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); } + + inline __complex__ double + __complex_sinh(__complex__ double __z) { return __builtin_csinh(__z); } + + inline __complex__ long double + __complex_sinh(const __complex__ long double& __z) + { return __builtin_csinhl(__z); } + + template + inline complex<_Tp> + sinh(const complex<_Tp>& __z) { return __complex_sinh(__z.__rep()); } +#else + template + inline complex<_Tp> + sinh(const complex<_Tp>& __z) { return __complex_sinh(__z); } +#endif + + // 26.2.8/13 sqrt(__z): Returns the complex square root of __z. + // The branch cut is on the negative axis. + template + complex<_Tp> + __complex_sqrt(const complex<_Tp>& __z) + { + _Tp __x = __z.real(); + _Tp __y = __z.imag(); + + if (__x == _Tp()) + { + _Tp __t = sqrt(abs(__y) / 2); + return complex<_Tp>(__t, __y < _Tp() ? -__t : __t); + } + else + { + _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x))); + _Tp __u = __t / 2; + return __x > _Tp() + ? complex<_Tp>(__u, __y / __t) + : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u); + } + } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_sqrt(__complex__ float __z) { return __builtin_csqrtf(__z); } + + inline __complex__ double + __complex_sqrt(__complex__ double __z) { return __builtin_csqrt(__z); } + + inline __complex__ long double + __complex_sqrt(const __complex__ long double& __z) + { return __builtin_csqrtl(__z); } + + template + inline complex<_Tp> + sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); } +#else + template + inline complex<_Tp> + sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z); } +#endif + + // 26.2.8/14 tan(__z): Return the complex tangent of __z. + + template + inline complex<_Tp> + __complex_tan(const complex<_Tp>& __z) + { return std::sin(__z) / std::cos(__z); } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_tan(__complex__ float __z) { return __builtin_ctanf(__z); } + + inline __complex__ double + __complex_tan(__complex__ double __z) { return __builtin_ctan(__z); } + + inline __complex__ long double + __complex_tan(const __complex__ long double& __z) + { return __builtin_ctanl(__z); } + + template + inline complex<_Tp> + tan(const complex<_Tp>& __z) { return __complex_tan(__z.__rep()); } +#else + template + inline complex<_Tp> + tan(const complex<_Tp>& __z) { return __complex_tan(__z); } +#endif + + + // 26.2.8/15 tanh(__z): Returns the hyperbolic tangent of __z. + + template + inline complex<_Tp> + __complex_tanh(const complex<_Tp>& __z) + { return std::sinh(__z) / std::cosh(__z); } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_tanh(__complex__ float __z) { return __builtin_ctanhf(__z); } + + inline __complex__ double + __complex_tanh(__complex__ double __z) { return __builtin_ctanh(__z); } + + inline __complex__ long double + __complex_tanh(const __complex__ long double& __z) + { return __builtin_ctanhl(__z); } + + template + inline complex<_Tp> + tanh(const complex<_Tp>& __z) { return __complex_tanh(__z.__rep()); } +#else + template + inline complex<_Tp> + tanh(const complex<_Tp>& __z) { return __complex_tanh(__z); } +#endif + + + // 26.2.8/9 pow(__x, __y): Returns the complex power base of __x + // raised to the __y-th power. The branch + // cut is on the negative axis. +#ifndef __GXX_EXPERIMENTAL_CXX0X__ + template + complex<_Tp> + __complex_pow_unsigned(complex<_Tp> __x, unsigned __n) + { + complex<_Tp> __y = __n % 2 ? __x : complex<_Tp>(1); + + while (__n >>= 1) + { + __x *= __x; + if (__n % 2) + __y *= __x; + } + + return __y; + } + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 844. complex pow return type is ambiguous. + template + inline complex<_Tp> + pow(const complex<_Tp>& __z, int __n) + { + return __n < 0 + ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -__n) + : std::__complex_pow_unsigned(__z, __n); + } +#endif + + template + complex<_Tp> + pow(const complex<_Tp>& __x, const _Tp& __y) + { +#ifndef _GLIBCXX_USE_C99_COMPLEX + if (__x == _Tp()) + return _Tp(); +#endif + if (__x.imag() == _Tp() && __x.real() > _Tp()) + return pow(__x.real(), __y); + + complex<_Tp> __t = std::log(__x); + return std::polar(exp(__y * __t.real()), __y * __t.imag()); + } + + template + inline complex<_Tp> + __complex_pow(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x)); } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_pow(__complex__ float __x, __complex__ float __y) + { return __builtin_cpowf(__x, __y); } + + inline __complex__ double + __complex_pow(__complex__ double __x, __complex__ double __y) + { return __builtin_cpow(__x, __y); } + + inline __complex__ long double + __complex_pow(const __complex__ long double& __x, + const __complex__ long double& __y) + { return __builtin_cpowl(__x, __y); } + + template + inline complex<_Tp> + pow(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __complex_pow(__x.__rep(), __y.__rep()); } +#else + template + inline complex<_Tp> + pow(const complex<_Tp>& __x, const complex<_Tp>& __y) + { return __complex_pow(__x, __y); } +#endif + + template + inline complex<_Tp> + pow(const _Tp& __x, const complex<_Tp>& __y) + { + return __x > _Tp() ? std::polar(pow(__x, __y.real()), + __y.imag() * log(__x)) + : std::pow(complex<_Tp>(__x), __y); + } + + // 26.2.3 complex specializations + // complex specialization + template<> + struct complex + { + typedef float value_type; + typedef __complex__ float _ComplexT; + + _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { } + + _GLIBCXX_CONSTEXPR complex(float __r = 0.0f, float __i = 0.0f) + : _M_value(__r + __i * 1.0fi) { } + + explicit _GLIBCXX_CONSTEXPR complex(const complex&); + explicit _GLIBCXX_CONSTEXPR complex(const complex&); + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 387. std::complex over-encapsulated. + constexpr float + real() const { return __real__ _M_value; } + + constexpr float + imag() const { return __imag__ _M_value; } +#else + float& + real() { return __real__ _M_value; } + + const float& + real() const { return __real__ _M_value; } + + float& + imag() { return __imag__ _M_value; } + + const float& + imag() const { return __imag__ _M_value; } +#endif + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 387. std::complex over-encapsulated. + void + real(float __val) { __real__ _M_value = __val; } + + void + imag(float __val) { __imag__ _M_value = __val; } + + complex& + operator=(float __f); + + complex& + operator+=(float __f) + { + _M_value += __f; + return *this; + } + + complex& + operator-=(float __f) + { + _M_value -= __f; + return *this; + } + + complex& + operator*=(float __f) + { + _M_value *= __f; + return *this; + } + + complex& + operator/=(float __f) + { + _M_value /= __f; + return *this; + } + + // Let the compiler synthesize the copy and assignment + // operator. It always does a pretty good job. + // complex& operator=(const complex&); + + template + complex& + operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template + complex& + operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template + complex& + operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template + complex& + operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template + complex& + operator/=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value /= __t; + return *this; + } + + _GLIBCXX_USE_CONSTEXPR _ComplexT __rep() const { return _M_value; } + + private: + _ComplexT _M_value; + }; + + // 26.2.3 complex specializations + // complex specialization + template<> + struct complex + { + typedef double value_type; + typedef __complex__ double _ComplexT; + + _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { } + + _GLIBCXX_CONSTEXPR complex(double __r = 0.0, double __i = 0.0) + : _M_value(__r + __i * 1.0i) { } + + _GLIBCXX_CONSTEXPR complex(const complex& __z) + : _M_value(__z.__rep()) { } + + explicit _GLIBCXX_CONSTEXPR complex(const complex&); + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 387. std::complex over-encapsulated. + constexpr double + real() const { return __real__ _M_value; } + + constexpr double + imag() const { return __imag__ _M_value; } +#else + double& + real() { return __real__ _M_value; } + + const double& + real() const { return __real__ _M_value; } + + double& + imag() { return __imag__ _M_value; } + + const double& + imag() const { return __imag__ _M_value; } +#endif + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 387. std::complex over-encapsulated. + void + real(double __val) { __real__ _M_value = __val; } + + void + imag(double __val) { __imag__ _M_value = __val; } + + complex& + operator=(double __d); + + complex& + operator+=(double __d) + { + _M_value += __d; + return *this; + } + + complex& + operator-=(double __d) + { + _M_value -= __d; + return *this; + } + + complex& + operator*=(double __d) + { + _M_value *= __d; + return *this; + } + + complex& + operator/=(double __d) + { + _M_value /= __d; + return *this; + } + + // The compiler will synthesize this, efficiently. + // complex& operator=(const complex&); + + template + complex& + operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template + complex& + operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template + complex& + operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template + complex& + operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template + complex& + operator/=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value /= __t; + return *this; + } + + _GLIBCXX_USE_CONSTEXPR _ComplexT __rep() const { return _M_value; } + + private: + _ComplexT _M_value; + }; + + // 26.2.3 complex specializations + // complex specialization + template<> + struct complex + { + typedef long double value_type; + typedef __complex__ long double _ComplexT; + + _GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { } + + _GLIBCXX_CONSTEXPR complex(long double __r = 0.0L, + long double __i = 0.0L) + : _M_value(__r + __i * 1.0Li) { } + + _GLIBCXX_CONSTEXPR complex(const complex& __z) + : _M_value(__z.__rep()) { } + + _GLIBCXX_CONSTEXPR complex(const complex& __z) + : _M_value(__z.__rep()) { } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 387. std::complex over-encapsulated. + constexpr long double + real() const { return __real__ _M_value; } + + constexpr long double + imag() const { return __imag__ _M_value; } +#else + long double& + real() { return __real__ _M_value; } + + const long double& + real() const { return __real__ _M_value; } + + long double& + imag() { return __imag__ _M_value; } + + const long double& + imag() const { return __imag__ _M_value; } +#endif + + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // DR 387. std::complex over-encapsulated. + void + real(long double __val) { __real__ _M_value = __val; } + + void + imag(long double __val) { __imag__ _M_value = __val; } + + complex& + operator=(long double __r); + + complex& + operator+=(long double __r) + { + _M_value += __r; + return *this; + } + + complex& + operator-=(long double __r) + { + _M_value -= __r; + return *this; + } + + complex& + operator*=(long double __r) + { + _M_value *= __r; + return *this; + } + + complex& + operator/=(long double __r) + { + _M_value /= __r; + return *this; + } + + // The compiler knows how to do this efficiently + // complex& operator=(const complex&); + + template + complex& + operator=(const complex<_Tp>& __z) + { + __real__ _M_value = __z.real(); + __imag__ _M_value = __z.imag(); + return *this; + } + + template + complex& + operator+=(const complex<_Tp>& __z) + { + __real__ _M_value += __z.real(); + __imag__ _M_value += __z.imag(); + return *this; + } + + template + complex& + operator-=(const complex<_Tp>& __z) + { + __real__ _M_value -= __z.real(); + __imag__ _M_value -= __z.imag(); + return *this; + } + + template + complex& + operator*=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value *= __t; + return *this; + } + + template + complex& + operator/=(const complex<_Tp>& __z) + { + _ComplexT __t; + __real__ __t = __z.real(); + __imag__ __t = __z.imag(); + _M_value /= __t; + return *this; + } + + _GLIBCXX_USE_CONSTEXPR _ComplexT __rep() const { return _M_value; } + + private: + _ComplexT _M_value; + }; + + // These bits have to be at the end of this file, so that the + // specializations have all been defined. + inline _GLIBCXX_CONSTEXPR + complex::complex(const complex& __z) + : _M_value(__z.__rep()) { } + + inline _GLIBCXX_CONSTEXPR + complex::complex(const complex& __z) + : _M_value(__z.__rep()) { } + + inline _GLIBCXX_CONSTEXPR + complex::complex(const complex& __z) + : _M_value(__z.__rep()) { } + + // 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 istream& operator>>(istream&, complex&); + extern template ostream& operator<<(ostream&, const complex&); + extern template istream& operator>>(istream&, complex&); + extern template ostream& operator<<(ostream&, const complex&); + extern template istream& operator>>(istream&, complex&); + extern template ostream& operator<<(ostream&, const complex&); + +#ifdef _GLIBCXX_USE_WCHAR_T + extern template wistream& operator>>(wistream&, complex&); + extern template wostream& operator<<(wostream&, const complex&); + extern template wistream& operator>>(wistream&, complex&); + extern template wostream& operator<<(wostream&, const complex&); + extern template wistream& operator>>(wistream&, complex&); + extern template wostream& operator<<(wostream&, const complex&); +#endif +#endif + + // @} group complex_numbers + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace + +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // See ext/type_traits.h for the primary template. + template + struct __promote_2, _Up> + { + public: + typedef std::complex::__type> __type; + }; + + template + struct __promote_2<_Tp, std::complex<_Up> > + { + public: + typedef std::complex::__type> __type; + }; + + template + struct __promote_2, std::complex<_Up> > + { + public: + typedef std::complex::__type> __type; + }; + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // Forward declarations. + template std::complex<_Tp> acos(const std::complex<_Tp>&); + template std::complex<_Tp> asin(const std::complex<_Tp>&); + template std::complex<_Tp> atan(const std::complex<_Tp>&); + + template std::complex<_Tp> acosh(const std::complex<_Tp>&); + template std::complex<_Tp> asinh(const std::complex<_Tp>&); + template std::complex<_Tp> atanh(const std::complex<_Tp>&); + // DR 595. + template _Tp fabs(const std::complex<_Tp>&); + + template + inline std::complex<_Tp> + __complex_acos(const std::complex<_Tp>& __z) + { + const std::complex<_Tp> __t = std::asin(__z); + const _Tp __pi_2 = 1.5707963267948966192313216916397514L; + return std::complex<_Tp>(__pi_2 - __t.real(), -__t.imag()); + } + +#if _GLIBCXX_USE_C99_COMPLEX_TR1 + inline __complex__ float + __complex_acos(__complex__ float __z) + { return __builtin_cacosf(__z); } + + inline __complex__ double + __complex_acos(__complex__ double __z) + { return __builtin_cacos(__z); } + + inline __complex__ long double + __complex_acos(const __complex__ long double& __z) + { return __builtin_cacosl(__z); } + + template + inline std::complex<_Tp> + acos(const std::complex<_Tp>& __z) + { return __complex_acos(__z.__rep()); } +#else + /// acos(__z) [8.1.2]. + // Effects: Behaves the same as C99 function cacos, defined + // in subclause 7.3.5.1. + template + inline std::complex<_Tp> + acos(const std::complex<_Tp>& __z) + { return __complex_acos(__z); } +#endif + + template + inline std::complex<_Tp> + __complex_asin(const std::complex<_Tp>& __z) + { + std::complex<_Tp> __t(-__z.imag(), __z.real()); + __t = std::asinh(__t); + return std::complex<_Tp>(__t.imag(), -__t.real()); + } + +#if _GLIBCXX_USE_C99_COMPLEX_TR1 + inline __complex__ float + __complex_asin(__complex__ float __z) + { return __builtin_casinf(__z); } + + inline __complex__ double + __complex_asin(__complex__ double __z) + { return __builtin_casin(__z); } + + inline __complex__ long double + __complex_asin(const __complex__ long double& __z) + { return __builtin_casinl(__z); } + + template + inline std::complex<_Tp> + asin(const std::complex<_Tp>& __z) + { return __complex_asin(__z.__rep()); } +#else + /// asin(__z) [8.1.3]. + // Effects: Behaves the same as C99 function casin, defined + // in subclause 7.3.5.2. + template + inline std::complex<_Tp> + asin(const std::complex<_Tp>& __z) + { return __complex_asin(__z); } +#endif + + template + std::complex<_Tp> + __complex_atan(const std::complex<_Tp>& __z) + { + const _Tp __r2 = __z.real() * __z.real(); + const _Tp __x = _Tp(1.0) - __r2 - __z.imag() * __z.imag(); + + _Tp __num = __z.imag() + _Tp(1.0); + _Tp __den = __z.imag() - _Tp(1.0); + + __num = __r2 + __num * __num; + __den = __r2 + __den * __den; + + return std::complex<_Tp>(_Tp(0.5) * atan2(_Tp(2.0) * __z.real(), __x), + _Tp(0.25) * log(__num / __den)); + } + +#if _GLIBCXX_USE_C99_COMPLEX_TR1 + inline __complex__ float + __complex_atan(__complex__ float __z) + { return __builtin_catanf(__z); } + + inline __complex__ double + __complex_atan(__complex__ double __z) + { return __builtin_catan(__z); } + + inline __complex__ long double + __complex_atan(const __complex__ long double& __z) + { return __builtin_catanl(__z); } + + template + inline std::complex<_Tp> + atan(const std::complex<_Tp>& __z) + { return __complex_atan(__z.__rep()); } +#else + /// atan(__z) [8.1.4]. + // Effects: Behaves the same as C99 function catan, defined + // in subclause 7.3.5.3. + template + inline std::complex<_Tp> + atan(const std::complex<_Tp>& __z) + { return __complex_atan(__z); } +#endif + + template + std::complex<_Tp> + __complex_acosh(const std::complex<_Tp>& __z) + { + std::complex<_Tp> __t((__z.real() - __z.imag()) + * (__z.real() + __z.imag()) - _Tp(1.0), + _Tp(2.0) * __z.real() * __z.imag()); + __t = std::sqrt(__t); + + return std::log(__t + __z); + } + +#if _GLIBCXX_USE_C99_COMPLEX_TR1 + inline __complex__ float + __complex_acosh(__complex__ float __z) + { return __builtin_cacoshf(__z); } + + inline __complex__ double + __complex_acosh(__complex__ double __z) + { return __builtin_cacosh(__z); } + + inline __complex__ long double + __complex_acosh(const __complex__ long double& __z) + { return __builtin_cacoshl(__z); } + + template + inline std::complex<_Tp> + acosh(const std::complex<_Tp>& __z) + { return __complex_acosh(__z.__rep()); } +#else + /// acosh(__z) [8.1.5]. + // Effects: Behaves the same as C99 function cacosh, defined + // in subclause 7.3.6.1. + template + inline std::complex<_Tp> + acosh(const std::complex<_Tp>& __z) + { return __complex_acosh(__z); } +#endif + + template + std::complex<_Tp> + __complex_asinh(const std::complex<_Tp>& __z) + { + std::complex<_Tp> __t((__z.real() - __z.imag()) + * (__z.real() + __z.imag()) + _Tp(1.0), + _Tp(2.0) * __z.real() * __z.imag()); + __t = std::sqrt(__t); + + return std::log(__t + __z); + } + +#if _GLIBCXX_USE_C99_COMPLEX_TR1 + inline __complex__ float + __complex_asinh(__complex__ float __z) + { return __builtin_casinhf(__z); } + + inline __complex__ double + __complex_asinh(__complex__ double __z) + { return __builtin_casinh(__z); } + + inline __complex__ long double + __complex_asinh(const __complex__ long double& __z) + { return __builtin_casinhl(__z); } + + template + inline std::complex<_Tp> + asinh(const std::complex<_Tp>& __z) + { return __complex_asinh(__z.__rep()); } +#else + /// asinh(__z) [8.1.6]. + // Effects: Behaves the same as C99 function casin, defined + // in subclause 7.3.6.2. + template + inline std::complex<_Tp> + asinh(const std::complex<_Tp>& __z) + { return __complex_asinh(__z); } +#endif + + template + std::complex<_Tp> + __complex_atanh(const std::complex<_Tp>& __z) + { + const _Tp __i2 = __z.imag() * __z.imag(); + const _Tp __x = _Tp(1.0) - __i2 - __z.real() * __z.real(); + + _Tp __num = _Tp(1.0) + __z.real(); + _Tp __den = _Tp(1.0) - __z.real(); + + __num = __i2 + __num * __num; + __den = __i2 + __den * __den; + + return std::complex<_Tp>(_Tp(0.25) * (log(__num) - log(__den)), + _Tp(0.5) * atan2(_Tp(2.0) * __z.imag(), __x)); + } + +#if _GLIBCXX_USE_C99_COMPLEX_TR1 + inline __complex__ float + __complex_atanh(__complex__ float __z) + { return __builtin_catanhf(__z); } + + inline __complex__ double + __complex_atanh(__complex__ double __z) + { return __builtin_catanh(__z); } + + inline __complex__ long double + __complex_atanh(const __complex__ long double& __z) + { return __builtin_catanhl(__z); } + + template + inline std::complex<_Tp> + atanh(const std::complex<_Tp>& __z) + { return __complex_atanh(__z.__rep()); } +#else + /// atanh(__z) [8.1.7]. + // Effects: Behaves the same as C99 function catanh, defined + // in subclause 7.3.6.3. + template + inline std::complex<_Tp> + atanh(const std::complex<_Tp>& __z) + { return __complex_atanh(__z); } +#endif + + template + inline _Tp + /// fabs(__z) [8.1.8]. + // Effects: Behaves the same as C99 function cabs, defined + // in subclause 7.3.8.1. + fabs(const std::complex<_Tp>& __z) + { return std::abs(__z); } + + /// Additional overloads [8.1.9]. + template + inline typename __gnu_cxx::__promote<_Tp>::__type + arg(_Tp __x) + { + typedef typename __gnu_cxx::__promote<_Tp>::__type __type; +#if (_GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) + return std::signbit(__x) ? __type(3.1415926535897932384626433832795029L) + : __type(); +#else + return std::arg(std::complex<__type>(__x)); +#endif + } + + template + inline typename __gnu_cxx::__promote<_Tp>::__type + imag(_Tp) + { return _Tp(); } + + template + inline typename __gnu_cxx::__promote<_Tp>::__type + norm(_Tp __x) + { + typedef typename __gnu_cxx::__promote<_Tp>::__type __type; + return __type(__x) * __type(__x); + } + + template + inline typename __gnu_cxx::__promote<_Tp>::__type + real(_Tp __x) + { return __x; } + + template + inline std::complex::__type> + pow(const std::complex<_Tp>& __x, const _Up& __y) + { + typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; + return std::pow(std::complex<__type>(__x), __type(__y)); + } + + template + inline std::complex::__type> + pow(const _Tp& __x, const std::complex<_Up>& __y) + { + typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; + return std::pow(__type(__x), std::complex<__type>(__y)); + } + + template + inline std::complex::__type> + pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y) + { + typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; + return std::pow(std::complex<__type>(__x), + std::complex<__type>(__y)); + } + + // Forward declarations. + // DR 781. + template std::complex<_Tp> proj(const std::complex<_Tp>&); + + template + std::complex<_Tp> + __complex_proj(const std::complex<_Tp>& __z) + { + const _Tp __den = (__z.real() * __z.real() + + __z.imag() * __z.imag() + _Tp(1.0)); + + return std::complex<_Tp>((_Tp(2.0) * __z.real()) / __den, + (_Tp(2.0) * __z.imag()) / __den); + } + +#if _GLIBCXX_USE_C99_COMPLEX + inline __complex__ float + __complex_proj(__complex__ float __z) + { return __builtin_cprojf(__z); } + + inline __complex__ double + __complex_proj(__complex__ double __z) + { return __builtin_cproj(__z); } + + inline __complex__ long double + __complex_proj(const __complex__ long double& __z) + { return __builtin_cprojl(__z); } + + template + inline std::complex<_Tp> + proj(const std::complex<_Tp>& __z) + { return __complex_proj(__z.__rep()); } +#else + template + inline std::complex<_Tp> + proj(const std::complex<_Tp>& __z) + { return __complex_proj(__z); } +#endif + + // DR 1137. + template + inline typename __gnu_cxx::__promote<_Tp>::__type + proj(_Tp __x) + { return __x; } + + template + inline typename __gnu_cxx::__promote<_Tp>::__type + conj(_Tp __x) + { return __x; } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace + +#endif // __GXX_EXPERIMENTAL_CXX0X__ + +#endif /* _GLIBCXX_COMPLEX */ diff --git a/GCC_XML/Support/GCC/4.6/emmintrin.h b/GCC_XML/Support/GCC/4.6/emmintrin.h new file mode 100644 index 0000000..ccd7e76 --- /dev/null +++ b/GCC_XML/Support/GCC/4.6/emmintrin.h @@ -0,0 +1,1510 @@ +/* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _EMMINTRIN_H_INCLUDED +#define _EMMINTRIN_H_INCLUDED + +#ifndef __SSE2__ +# error "SSE2 instruction set not enabled" +#else + +/* We need definitions from the SSE header files*/ +#include + +/* SSE2 */ +typedef double __v2df __attribute__ ((__vector_size__ (16))); +typedef long long __v2di __attribute__ ((__vector_size__ (16))); +typedef int __v4si __attribute__ ((__vector_size__ (16))); +typedef short __v8hi __attribute__ ((__vector_size__ (16))); +typedef char __v16qi __attribute__ ((__vector_size__ (16))); + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Create a selector for use with the SHUFPD instruction. */ +#define _MM_SHUFFLE2(fp1,fp0) \ + (((fp1) << 1) | (fp0)) + +/* Create a vector with element 0 as F and the rest zero. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_sd (double __F) +{ + return __extension__ (__m128d){ __F, 0.0 }; +} + +/* Create a vector with both elements equal to F. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pd (double __F) +{ + return __extension__ (__m128d){ __F, __F }; +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pd1 (double __F) +{ + return _mm_set1_pd (__F); +} + +/* Create a vector with the lower value X and upper value W. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pd (double __W, double __X) +{ + return __extension__ (__m128d){ __X, __W }; +} + +/* Create a vector with the lower value W and upper value X. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pd (double __W, double __X) +{ + return __extension__ (__m128d){ __W, __X }; +} + +/* Create a vector of zeros. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_pd (void) +{ + return __extension__ (__m128d){ 0.0, 0.0 }; +} + +/* Sets the low DPFP value of A from the low value of B. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); +} + +/* Load two DPFP values from P. The address must be 16-byte aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_pd (double const *__P) +{ + return *(__m128d *)__P; +} + +/* Load two DPFP values from P. The address need not be 16-byte aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_pd (double const *__P) +{ + return __builtin_ia32_loadupd (__P); +} + +/* Create a vector with all two elements equal to *P. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load1_pd (double const *__P) +{ + return _mm_set1_pd (*__P); +} + +/* Create a vector with element 0 as *P and the rest zero. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_sd (double const *__P) +{ + return _mm_set_sd (*__P); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_pd1 (double const *__P) +{ + return _mm_load1_pd (__P); +} + +/* Load two DPFP values in reverse order. The address must be aligned. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadr_pd (double const *__P) +{ + __m128d __tmp = _mm_load_pd (__P); + return __builtin_ia32_shufpd (__tmp, __tmp, _MM_SHUFFLE2 (0,1)); +} + +/* Store two DPFP values. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_pd (double *__P, __m128d __A) +{ + *(__m128d *)__P = __A; +} + +/* Store two DPFP values. The address need not be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_pd (double *__P, __m128d __A) +{ + __builtin_ia32_storeupd (__P, __A); +} + +/* Stores the lower DPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_sd (double *__P, __m128d __A) +{ + *__P = __builtin_ia32_vec_ext_v2df (__A, 0); +} + +extern __inline double __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_f64 (__m128d __A) +{ + return __builtin_ia32_vec_ext_v2df (__A, 0); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_pd (double *__P, __m128d __A) +{ + _mm_store_sd (__P, __A); +} + +/* Stores the upper DPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeh_pd (double *__P, __m128d __A) +{ + *__P = __builtin_ia32_vec_ext_v2df (__A, 1); +} + +/* Store the lower DPFP value across two words. + The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store1_pd (double *__P, __m128d __A) +{ + _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,0))); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_pd1 (double *__P, __m128d __A) +{ + _mm_store1_pd (__P, __A); +} + +/* Store two DPFP values in reverse order. The address must be aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storer_pd (double *__P, __m128d __A) +{ + _mm_store_pd (__P, __builtin_ia32_shufpd (__A, __A, _MM_SHUFFLE2 (0,1))); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si32 (__m128i __A) +{ + return __builtin_ia32_vec_ext_v4si ((__v4si)__A, 0); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si64 (__m128i __A) +{ + return __builtin_ia32_vec_ext_v2di ((__v2di)__A, 0); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi128_si64x (__m128i __A) +{ + return __builtin_ia32_vec_ext_v2di ((__v2di)__A, 0); +} +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_addpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_addsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_subpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_subsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_mulpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_mulsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_divpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_divsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_pd (__m128d __A) +{ + return (__m128d)__builtin_ia32_sqrtpd ((__v2df)__A); +} + +/* Return pair {sqrt (A[0), B[1]}. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_sd (__m128d __A, __m128d __B) +{ + __v2df __tmp = __builtin_ia32_movsd ((__v2df)__A, (__v2df)__B); + return (__m128d)__builtin_ia32_sqrtsd ((__v2df)__tmp); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_minpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_minsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_maxpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_maxsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_andpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_andnpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_orpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_xorpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpeqpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpltpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmplepd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpgtpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpgepd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpneqpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpnltpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpnlepd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpngtpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpngepd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpordpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpunordpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpeqsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpltsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmplesd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df) __A, + (__v2df) + __builtin_ia32_cmpltsd ((__v2df) __B, + (__v2df) + __A)); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df) __A, + (__v2df) + __builtin_ia32_cmplesd ((__v2df) __B, + (__v2df) + __A)); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpneqsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpnltsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpnlesd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df) __A, + (__v2df) + __builtin_ia32_cmpnltsd ((__v2df) __B, + (__v2df) + __A)); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_sd (__m128d __A, __m128d __B) +{ + return (__m128d) __builtin_ia32_movsd ((__v2df) __A, + (__v2df) + __builtin_ia32_cmpnlesd ((__v2df) __B, + (__v2df) + __A)); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpordsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_sd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_cmpunordsd ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comieq_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdeq ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comilt_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdlt ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comile_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdle ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comigt_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdgt ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comige_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdge ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comineq_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_comisdneq ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomieq_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdeq ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomilt_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdlt ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomile_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdle ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomigt_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdgt ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomige_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdge ((__v2df)__A, (__v2df)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomineq_sd (__m128d __A, __m128d __B) +{ + return __builtin_ia32_ucomisdneq ((__v2df)__A, (__v2df)__B); +} + +/* Create a vector of Qi, where i is the element number. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi64x (long long __q1, long long __q0) +{ + return __extension__ (__m128i)(__v2di){ __q0, __q1 }; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi64 (__m64 __q1, __m64 __q0) +{ + return _mm_set_epi64x ((long long)__q1, (long long)__q0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi32 (int __q3, int __q2, int __q1, int __q0) +{ + return __extension__ (__m128i)(__v4si){ __q0, __q1, __q2, __q3 }; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi16 (short __q7, short __q6, short __q5, short __q4, + short __q3, short __q2, short __q1, short __q0) +{ + return __extension__ (__m128i)(__v8hi){ + __q0, __q1, __q2, __q3, __q4, __q5, __q6, __q7 }; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_epi8 (char __q15, char __q14, char __q13, char __q12, + char __q11, char __q10, char __q09, char __q08, + char __q07, char __q06, char __q05, char __q04, + char __q03, char __q02, char __q01, char __q00) +{ + return __extension__ (__m128i)(__v16qi){ + __q00, __q01, __q02, __q03, __q04, __q05, __q06, __q07, + __q08, __q09, __q10, __q11, __q12, __q13, __q14, __q15 + }; +} + +/* Set all of the elements of the vector to A. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi64x (long long __A) +{ + return _mm_set_epi64x (__A, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi64 (__m64 __A) +{ + return _mm_set_epi64 (__A, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi32 (int __A) +{ + return _mm_set_epi32 (__A, __A, __A, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi16 (short __A) +{ + return _mm_set_epi16 (__A, __A, __A, __A, __A, __A, __A, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_epi8 (char __A) +{ + return _mm_set_epi8 (__A, __A, __A, __A, __A, __A, __A, __A, + __A, __A, __A, __A, __A, __A, __A, __A); +} + +/* Create a vector of Qi, where i is the element number. + The parameter order is reversed from the _mm_set_epi* functions. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi64 (__m64 __q0, __m64 __q1) +{ + return _mm_set_epi64 (__q1, __q0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi32 (int __q0, int __q1, int __q2, int __q3) +{ + return _mm_set_epi32 (__q3, __q2, __q1, __q0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi16 (short __q0, short __q1, short __q2, short __q3, + short __q4, short __q5, short __q6, short __q7) +{ + return _mm_set_epi16 (__q7, __q6, __q5, __q4, __q3, __q2, __q1, __q0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_epi8 (char __q00, char __q01, char __q02, char __q03, + char __q04, char __q05, char __q06, char __q07, + char __q08, char __q09, char __q10, char __q11, + char __q12, char __q13, char __q14, char __q15) +{ + return _mm_set_epi8 (__q15, __q14, __q13, __q12, __q11, __q10, __q09, __q08, + __q07, __q06, __q05, __q04, __q03, __q02, __q01, __q00); +} + +/* Create a vector with element 0 as *P and the rest zero. */ + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_si128 (__m128i const *__P) +{ + return *__P; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_si128 (__m128i const *__P) +{ + return (__m128i) __builtin_ia32_loaddqu ((char const *)__P); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_epi64 (__m128i const *__P) +{ + return _mm_set_epi64 ((__m64)0LL, *(__m64 *)__P); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_si128 (__m128i *__P, __m128i __B) +{ + *__P = __B; +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_si128 (__m128i *__P, __m128i __B) +{ + __builtin_ia32_storedqu ((char *)__P, (__v16qi)__B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_epi64 (__m128i *__P, __m128i __B) +{ + *(long long *)__P = __builtin_ia32_vec_ext_v2di ((__v2di)__B, 0); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movepi64_pi64 (__m128i __B) +{ + return (__m64) __builtin_ia32_vec_ext_v2di ((__v2di)__B, 0); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movpi64_epi64 (__m64 __A) +{ + return _mm_set_epi64 ((__m64)0LL, __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_epi64 (__m128i __A); + +/* Create a vector of zeros. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_si128 (void) +{ + return __extension__ (__m128i)(__v4si){ 0, 0, 0, 0 }; +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtepi32_pd (__m128i __A) +{ + return (__m128d)__builtin_ia32_cvtdq2pd ((__v4si) __A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtepi32_ps (__m128i __A) +{ + return (__m128)__builtin_ia32_cvtdq2ps ((__v4si) __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_epi32 (__m128d __A) +{ + return (__m128i)__builtin_ia32_cvtpd2dq ((__v2df) __A); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_pi32 (__m128d __A) +{ + return (__m64)__builtin_ia32_cvtpd2pi ((__v2df) __A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpd_ps (__m128d __A) +{ + return (__m128)__builtin_ia32_cvtpd2ps ((__v2df) __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttpd_epi32 (__m128d __A) +{ + return (__m128i)__builtin_ia32_cvttpd2dq ((__v2df) __A); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttpd_pi32 (__m128d __A) +{ + return (__m64)__builtin_ia32_cvttpd2pi ((__v2df) __A); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32_pd (__m64 __A) +{ + return (__m128d)__builtin_ia32_cvtpi2pd ((__v2si) __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_epi32 (__m128 __A) +{ + return (__m128i)__builtin_ia32_cvtps2dq ((__v4sf) __A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttps_epi32 (__m128 __A) +{ + return (__m128i)__builtin_ia32_cvttps2dq ((__v4sf) __A); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pd (__m128 __A) +{ + return (__m128d)__builtin_ia32_cvtps2pd ((__v4sf) __A); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si32 (__m128d __A) +{ + return __builtin_ia32_cvtsd2si ((__v2df) __A); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si64 (__m128d __A) +{ + return __builtin_ia32_cvtsd2si64 ((__v2df) __A); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_si64x (__m128d __A) +{ + return __builtin_ia32_cvtsd2si64 ((__v2df) __A); +} +#endif + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si32 (__m128d __A) +{ + return __builtin_ia32_cvttsd2si ((__v2df) __A); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si64 (__m128d __A) +{ + return __builtin_ia32_cvttsd2si64 ((__v2df) __A); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttsd_si64x (__m128d __A) +{ + return __builtin_ia32_cvttsd2si64 ((__v2df) __A); +} +#endif + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsd_ss (__m128 __A, __m128d __B) +{ + return (__m128)__builtin_ia32_cvtsd2ss ((__v4sf) __A, (__v2df) __B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_sd (__m128d __A, int __B) +{ + return (__m128d)__builtin_ia32_cvtsi2sd ((__v2df) __A, __B); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_sd (__m128d __A, long long __B) +{ + return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); +} + +/* Microsoft intrinsic. */ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_sd (__m128d __A, long long __B) +{ + return (__m128d)__builtin_ia32_cvtsi642sd ((__v2df) __A, __B); +} +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_sd (__m128d __A, __m128 __B) +{ + return (__m128d)__builtin_ia32_cvtss2sd ((__v2df) __A, (__v4sf)__B); +} + +#ifdef __OPTIMIZE__ +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_pd(__m128d __A, __m128d __B, const int __mask) +{ + return (__m128d)__builtin_ia32_shufpd ((__v2df)__A, (__v2df)__B, __mask); +} +#else +#define _mm_shuffle_pd(A, B, N) \ + ((__m128d)__builtin_ia32_shufpd ((__v2df)(__m128d)(A), \ + (__v2df)(__m128d)(B), (int)(N))) +#endif + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_unpckhpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pd (__m128d __A, __m128d __B) +{ + return (__m128d)__builtin_ia32_unpcklpd ((__v2df)__A, (__v2df)__B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadh_pd (__m128d __A, double const *__B) +{ + return (__m128d)__builtin_ia32_loadhpd ((__v2df)__A, __B); +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_pd (__m128d __A, double const *__B) +{ + return (__m128d)__builtin_ia32_loadlpd ((__v2df)__A, __B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_pd (__m128d __A) +{ + return __builtin_ia32_movmskpd ((__v2df)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_packsswb128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_packssdw128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packus_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_packuswb128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckhbw128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckhwd128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckhdq128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckhqdq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpcklbw128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpcklwd128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpckldq128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_punpcklqdq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddd128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddsb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddsw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddusb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_epu16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_paddusw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubd128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubsb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubsw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubusb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_epu16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psubusw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_madd_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmaddwd128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmulhw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mullo_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmullw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_su32 (__m64 __A, __m64 __B) +{ + return (__m64)__builtin_ia32_pmuludq ((__v2si)__A, (__v2si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_epu32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmuludq128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi16 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psllwi128 ((__v8hi)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi32 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_pslldi128 ((__v4si)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_epi64 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psllqi128 ((__v2di)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_epi16 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psrawi128 ((__v8hi)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_epi32 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B); +} + +#ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_si128 (__m128i __A, const int __N) +{ + return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_si128 (__m128i __A, const int __N) +{ + return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8); +} +#else +#define _mm_srli_si128(A, N) \ + ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8)) +#define _mm_slli_si128(A, N) \ + ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8)) +#endif + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi16 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psrlwi128 ((__v8hi)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi32 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psrldi128 ((__v4si)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_epi64 (__m128i __A, int __B) +{ + return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psllw128((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pslld128((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psllq128((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psraw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrad128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrlw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrld128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_epi64 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psrlq128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pand128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pandn128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_por128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_si128 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pxor128 ((__v2di)__A, (__v2di)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpeqb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpeqw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpeqd128 ((__v4si)__A, (__v4si)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__B, (__v16qi)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__B, (__v8hi)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__B, (__v4si)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_epi32 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pcmpgtd128 ((__v4si)__A, (__v4si)__B); +} + +#ifdef __OPTIMIZE__ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_epi16 (__m128i const __A, int const __N) +{ + return (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)__A, __N); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_epi16 (__m128i const __A, int const __D, int const __N) +{ + return (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)__A, __D, __N); +} +#else +#define _mm_extract_epi16(A, N) \ + ((int) (unsigned short) __builtin_ia32_vec_ext_v8hi ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_insert_epi16(A, D, N) \ + ((__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)(__m128i)(A), \ + (int)(D), (int)(N))) +#endif + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmaxsw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmaxub128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_epi16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pminsw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pminub128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_epi8 (__m128i __A) +{ + return __builtin_ia32_pmovmskb128 ((__v16qi)__A); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_epu16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pmulhuw128 ((__v8hi)__A, (__v8hi)__B); +} + +#ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shufflehi_epi16 (__m128i __A, const int __mask) +{ + return (__m128i)__builtin_ia32_pshufhw ((__v8hi)__A, __mask); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shufflelo_epi16 (__m128i __A, const int __mask) +{ + return (__m128i)__builtin_ia32_pshuflw ((__v8hi)__A, __mask); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_epi32 (__m128i __A, const int __mask) +{ + return (__m128i)__builtin_ia32_pshufd ((__v4si)__A, __mask); +} +#else +#define _mm_shufflehi_epi16(A, N) \ + ((__m128i)__builtin_ia32_pshufhw ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_shufflelo_epi16(A, N) \ + ((__m128i)__builtin_ia32_pshuflw ((__v8hi)(__m128i)(A), (int)(N))) +#define _mm_shuffle_epi32(A, N) \ + ((__m128i)__builtin_ia32_pshufd ((__v4si)(__m128i)(A), (int)(N))) +#endif + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskmoveu_si128 (__m128i __A, __m128i __B, char *__C) +{ + __builtin_ia32_maskmovdqu ((__v16qi)__A, (__v16qi)__B, __C); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pavgb128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_epu16 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_pavgw128 ((__v8hi)__A, (__v8hi)__B); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sad_epu8 (__m128i __A, __m128i __B) +{ + return (__m128i)__builtin_ia32_psadbw128 ((__v16qi)__A, (__v16qi)__B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_si32 (int *__A, int __B) +{ + __builtin_ia32_movnti (__A, __B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_si128 (__m128i *__A, __m128i __B) +{ + __builtin_ia32_movntdq ((__v2di *)__A, (__v2di)__B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_pd (double *__A, __m128d __B) +{ + __builtin_ia32_movntpd (__A, (__v2df)__B); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_clflush (void const *__A) +{ + __builtin_ia32_clflush (__A); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_lfence (void) +{ + __builtin_ia32_lfence (); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mfence (void) +{ + __builtin_ia32_mfence (); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_si128 (int __A) +{ + return _mm_set_epi32 (0, 0, 0, __A); +} + +#ifdef __x86_64__ +/* Intel intrinsic. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si128 (long long __A) +{ + return _mm_set_epi64x (0, __A); +} + +/* Microsoft intrinsic. */ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_si128 (long long __A) +{ + return _mm_set_epi64x (0, __A); +} +#endif + +/* Casts between various SP, DP, INT vector types. Note that these do no + conversion of values, they just change the type. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castpd_ps(__m128d __A) +{ + return (__m128) __A; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castpd_si128(__m128d __A) +{ + return (__m128i) __A; +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castps_pd(__m128 __A) +{ + return (__m128d) __A; +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castps_si128(__m128 __A) +{ + return (__m128i) __A; +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castsi128_ps(__m128i __A) +{ + return (__m128) __A; +} + +extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_castsi128_pd(__m128i __A) +{ + return (__m128d) __A; +} + +#endif /* __SSE2__ */ + +#endif /* _EMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.6/gccxml_builtins.h b/GCC_XML/Support/GCC/4.6/gccxml_builtins.h new file mode 100644 index 0000000..1e347eb --- /dev/null +++ b/GCC_XML/Support/GCC/4.6/gccxml_builtins.h @@ -0,0 +1,160 @@ +#define __builtin_apply(x,y,z) ((void*)0) +#define __builtin_nan(x) (0.0) +#define __builtin_nanf(x) (0.0f) +#define __builtin_nanl(x) (0.0l) +#define __builtin_huge_val(x) (0.0) +#define __builtin_huge_valf(x) (0.0f) +#define __builtin_huge_vall(x) (0.0l) +#define __builtin_apply_args(x) ((void*)0) +#define __builtin_types_compatible_p(x,y) 0 +#define __builtin_choose_expr(x,y,z) int +#define __builtin_constant_p(x) 0 +void* __builtin_memchr(void const*, int, unsigned int); +void __builtin_return (void *RESULT); +void * __builtin_return_address (unsigned int LEVEL); +void * __builtin_frame_address (unsigned int LEVEL); +long __builtin_expect (long EXP, long C); +void __builtin_prefetch (const void *ADDR, ...); +double __builtin_inf (void); +float __builtin_inff (void); +long double __builtin_infl (void); +double __builtin_nans (const char *str); +float __builtin_nansf (const char *str); +long double __builtin_nansl (const char *str); +double __builtin_acos(double); +float __builtin_acosf(float); +long double __builtin_acosl(long double); +double __builtin_asin(double); +float __builtin_asinf(float); +long double __builtin_asinl(long double); +double __builtin_atan(double); +double __builtin_atan2(double, double); +float __builtin_atan2f(float, float); +long double __builtin_atan2l(long double, long double); +float __builtin_atanf(float); +long double __builtin_atanl(long double); +double __builtin_ceil(double); +float __builtin_ceilf(float); +long double __builtin_ceill(long double); +double __builtin_cos(double); +float __builtin_cosf(float); +double __builtin_cosh(double); +float __builtin_coshf(float); +long double __builtin_coshl(long double); +long double __builtin_cosl(long double); +double __builtin_exp(double); +float __builtin_expf(float); +long double __builtin_expl(long double); +double __builtin_fabs(double); +float __builtin_fabsf(float); +long double __builtin_fabsl(long double); +double __builtin_floor(double); +float __builtin_floorf(float); +long double __builtin_floorl(long double); +float __builtin_fmodf(float, float); +long double __builtin_fmodl(long double, long double); +double __builtin_frexp(double, int*); +float __builtin_frexpf(float, int*); +long double __builtin_frexpl(long double, int*); +double __builtin_ldexp(double, int); +float __builtin_ldexpf(float, int); +long double __builtin_ldexpl(long double, int); +double __builtin_log(double); +double __builtin_log10(double); +float __builtin_log10f(float); +long double __builtin_log10l(long double); +float __builtin_logf(float); +long double __builtin_logl(long double); +float __builtin_modff(float, float*); +long double __builtin_modfl(long double, long double*); +float __builtin_powf(float, float); +long double __builtin_powl(long double, long double); +double __builtin_powi(double, int); +float __builtin_powif(float, int); +long double __builtin_powil(long double, int); +double __builtin_sin(double); +float __builtin_sinf(float); +double __builtin_sinh(double); +float __builtin_sinhf(float); +long double __builtin_sinhl(long double); +long double __builtin_sinl(long double); +double __builtin_sqrt(double); +float __builtin_sqrtf(float); +long double __builtin_sqrtl(long double); +double __builtin_tan(double); +float __builtin_tanf(float); +double __builtin_tanh(double); +float __builtin_tanhf(float); +long double __builtin_tanhl(long double); +long double __builtin_tanl(long double); +float __builtin_cabsf(float __complex__); +double __builtin_cabs(double __complex__); +long double __builtin_cabsl(long double __complex__); +float __builtin_cargf(float __complex__); +double __builtin_carg(double __complex__); +long double __builtin_cargl(long double __complex__); +int __builtin_ctz(int); +int __builtin_ctzl(long); +int __builtin_ctzll(long long); +int __builtin_popcount(int); +int __builtin_popcountl(long); +int __builtin_popcountll(long long); +float __complex__ __builtin_ccosf(float __complex__); +double __complex__ __builtin_ccos(double __complex__); +long double __complex__ __builtin_ccosl(long double __complex__); +float __complex__ __builtin_ccoshf(float __complex__); +double __complex__ __builtin_ccosh(double __complex__); +long double __complex__ __builtin_ccoshl(long double __complex__); +float __complex__ __builtin_cexpf(float __complex__); +double __complex__ __builtin_cexp(double __complex__); +long double __complex__ __builtin_cexpl(long double __complex__); +float __complex__ __builtin_clogf(float __complex__); +double __complex__ __builtin_clog(double __complex__); +long double __complex__ __builtin_clogl(long double __complex__); +float __complex__ __builtin_csinf(float __complex__); +double __complex__ __builtin_csin(double __complex__); +long double __complex__ __builtin_csinl(long double __complex__); +float __complex__ __builtin_csinhf(float __complex__); +double __complex__ __builtin_csinh(double __complex__); +long double __complex__ __builtin_csinhl(long double __complex__); +float __complex__ __builtin_csqrtf(float __complex__); +double __complex__ __builtin_csqrt(double __complex__); +long double __complex__ __builtin_csqrtl(long double __complex__); +float __complex__ __builtin_ctanf(float __complex__); +double __complex__ __builtin_ctan(double __complex__); +long double __complex__ __builtin_ctanl(long double __complex__); +float __complex__ __builtin_ctanhf(float __complex__); +double __complex__ __builtin_ctanh(double __complex__); +long double __complex__ __builtin_ctanhl(long double __complex__); +float __complex__ __builtin_cpowf(float __complex__, float __complex__); +double __complex__ __builtin_cpow(double __complex__, double __complex__); +long double __complex__ __builtin_cpowl(long double __complex__, long double __complex__); + +/* The GCC 4.5 parser hard-codes handling of these, so they do not + have real signatures. */ +bool __builtin_fpclassify(...); +bool __builtin_isfinite(...); +bool __builtin_isgreater(...); +bool __builtin_isgreaterequal(...); +bool __builtin_isinf(...); +bool __builtin_isinf_sign(...); +bool __builtin_isless(...); +bool __builtin_islessequal(...); +bool __builtin_islessgreater(...); +bool __builtin_isnan(...); +bool __builtin_isnormal(...); +bool __builtin_isunordered(...); +bool __builtin_va_arg_pack(...); +int __builtin_va_arg_pack_len(...); + +/* We fake some constant expressions from GCC 4.5 parser. */ +#define __is_empty(x) false +#define __is_pod(x) false +#define __is_trivial(x) false +#define __has_trivial_destructor(x) false +#define __has_trivial_constructor(x) false + +#ifdef __llvm__ +extern unsigned int __builtin_bswap32(unsigned int _data); +extern unsigned long __builtin_bswap64(unsigned long _data); +#endif diff --git a/GCC_XML/Support/GCC/4.6/iomanip b/GCC_XML/Support/GCC/4.6/iomanip new file mode 100644 index 0000000..2e19c4c --- /dev/null +++ b/GCC_XML/Support/GCC/4.6/iomanip @@ -0,0 +1,352 @@ +// Standard stream manipulators -*- C++ -*- + +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +// 2006, 2007, 2008, 2009, 2010 +// 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 + +#pragma GCC system_header + +#include +#include +#include + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ +#include +#endif + +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) + { _Resetiosflags r = { __mask }; return r; } + + 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) + { _Setiosflags s = { __mask }; return s; } + + 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) + { _Setbase s = { __base }; return s; } + + 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) + { _Setfill<_CharT> s = { __c }; return s; } + + 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) + { _Setprecision s = { __n }; return s; } + + 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) + { _Setw s = {__n} ; return s; } + + 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; + } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + + 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) + { + typedef istreambuf_iterator<_CharT, _Traits> _Iter; + typedef money_get<_CharT, _Iter> _MoneyGet; + + ios_base::iostate __err = ios_base::goodbit; + const _MoneyGet& __mg = use_facet<_MoneyGet>(__is.getloc()); + + __mg.get(_Iter(__is.rdbuf()), _Iter(), __f._M_intl, + __is, __err, __f._M_mon); + + if (ios_base::goodbit != __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) + { + typedef ostreambuf_iterator<_CharT, _Traits> _Iter; + typedef money_put<_CharT, _Iter> _MoneyPut; + + const _MoneyPut& __mp = use_facet<_MoneyPut>(__os.getloc()); + const _Iter __end = __mp.put(_Iter(__os.rdbuf()), __f._M_intl, + __os, __os.fill(), __f._M_mon); + + if (__end.failed()) + __os.setstate(ios_base::badbit); + + return __os; + } + +#endif + + // 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 +#endif + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace + +#endif /* _GLIBCXX_IOMANIP */ diff --git a/GCC_XML/Support/GCC/4.6/mmintrin.h b/GCC_XML/Support/GCC/4.6/mmintrin.h new file mode 100644 index 0000000..7e0111b --- /dev/null +++ b/GCC_XML/Support/GCC/4.6/mmintrin.h @@ -0,0 +1,867 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _MMINTRIN_H_INCLUDED +#define _MMINTRIN_H_INCLUDED + +#ifndef __MMX__ +# error "MMX instruction set not enabled" +#else +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef int __v2si __attribute__ ((__vector_size__ (8))); +typedef short __v4hi __attribute__ ((__vector_size__ (8))); +typedef char __v8qi __attribute__ ((__vector_size__ (8))); +typedef long long __v1di __attribute__ ((__vector_size__ (8))); +typedef float __v2sf __attribute__ ((__vector_size__ (8))); + +/* Empty the multimedia state. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_empty (void) +{ + __builtin_ia32_emms (); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_empty (void) +{ + _mm_empty (); +} + +/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_si64 (int __i) +{ + return (__m64) __builtin_ia32_vec_init_v2si (__i, 0); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_from_int (int __i) +{ + return _mm_cvtsi32_si64 (__i); +} + +#ifdef __x86_64__ +/* Convert I to a __m64 object. */ + +/* Intel intrinsic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_from_int64 (long long __i) +{ + return (__m64) __i; +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_m64 (long long __i) +{ + return (__m64) __i; +} + +/* Microsoft intrinsic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_si64 (long long __i) +{ + return (__m64) __i; +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi64x (long long __i) +{ + return (__m64) __i; +} +#endif + +/* Convert the lower 32 bits of the __m64 object into an integer. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si32 (__m64 __i) +{ + return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_to_int (__m64 __i) +{ + return _mm_cvtsi64_si32 (__i); +} + +#ifdef __x86_64__ +/* Convert the __m64 object to a 64bit integer. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_to_int64 (__m64 __i) +{ + return (long long)__i; +} + +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtm64_si64 (__m64 __i) +{ + return (long long)__i; +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_si64x (__m64 __i) +{ + return (long long)__i; +} +#endif + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with signed saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_packsswb ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packsswb (__m64 __m1, __m64 __m2) +{ + return _mm_packs_pi16 (__m1, __m2); +} + +/* Pack the two 32-bit values from M1 in to the lower two 16-bit values of + the result, and the two 32-bit values from M2 into the upper two 16-bit + values of the result, all with signed saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_packssdw ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packssdw (__m64 __m1, __m64 __m2) +{ + return _mm_packs_pi32 (__m1, __m2); +} + +/* Pack the four 16-bit values from M1 into the lower four 8-bit values of + the result, and the four 16-bit values from M2 into the upper four 8-bit + values of the result, all with unsigned saturation. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_packs_pu16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_packuswb ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_packuswb (__m64 __m1, __m64 __m2) +{ + return _mm_packs_pu16 (__m1, __m2); +} + +/* Interleave the four 8-bit values from the high half of M1 with the four + 8-bit values from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpckhbw ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhbw (__m64 __m1, __m64 __m2) +{ + return _mm_unpackhi_pi8 (__m1, __m2); +} + +/* Interleave the two 16-bit values from the high half of M1 with the two + 16-bit values from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpckhwd ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhwd (__m64 __m1, __m64 __m2) +{ + return _mm_unpackhi_pi16 (__m1, __m2); +} + +/* Interleave the 32-bit value from the high half of M1 with the 32-bit + value from the high half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpckhdq ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckhdq (__m64 __m1, __m64 __m2) +{ + return _mm_unpackhi_pi32 (__m1, __m2); +} + +/* Interleave the four 8-bit values from the low half of M1 with the four + 8-bit values from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpcklbw ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpcklbw (__m64 __m1, __m64 __m2) +{ + return _mm_unpacklo_pi8 (__m1, __m2); +} + +/* Interleave the two 16-bit values from the low half of M1 with the two + 16-bit values from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpcklwd ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpcklwd (__m64 __m1, __m64 __m2) +{ + return _mm_unpacklo_pi16 (__m1, __m2); +} + +/* Interleave the 32-bit value from the low half of M1 with the 32-bit + value from the low half of M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_punpckldq ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_punpckldq (__m64 __m1, __m64 __m2) +{ + return _mm_unpacklo_pi32 (__m1, __m2); +} + +/* Add the 8-bit values in M1 to the 8-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddb (__m64 __m1, __m64 __m2) +{ + return _mm_add_pi8 (__m1, __m2); +} + +/* Add the 16-bit values in M1 to the 16-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddw (__m64 __m1, __m64 __m2) +{ + return _mm_add_pi16 (__m1, __m2); +} + +/* Add the 32-bit values in M1 to the 32-bit values in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddd ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddd (__m64 __m1, __m64 __m2) +{ + return _mm_add_pi32 (__m1, __m2); +} + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_si64 (__m64 __m1, __m64 __m2); +#endif + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using signed + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddsb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddsb (__m64 __m1, __m64 __m2) +{ + return _mm_adds_pi8 (__m1, __m2); +} + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using signed + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddsw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddsw (__m64 __m1, __m64 __m2) +{ + return _mm_adds_pi16 (__m1, __m2); +} + +/* Add the 8-bit values in M1 to the 8-bit values in M2 using unsigned + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pu8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddusb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddusb (__m64 __m1, __m64 __m2) +{ + return _mm_adds_pu8 (__m1, __m2); +} + +/* Add the 16-bit values in M1 to the 16-bit values in M2 using unsigned + saturated arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_adds_pu16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_paddusw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_paddusw (__m64 __m1, __m64 __m2) +{ + return _mm_adds_pu16 (__m1, __m2); +} + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubb (__m64 __m1, __m64 __m2) +{ + return _mm_sub_pi8 (__m1, __m2); +} + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubw (__m64 __m1, __m64 __m2) +{ + return _mm_sub_pi16 (__m1, __m2); +} + +/* Subtract the 32-bit values in M2 from the 32-bit values in M1. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubd ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubd (__m64 __m1, __m64 __m2) +{ + return _mm_sub_pi32 (__m1, __m2); +} + +/* Add the 64-bit values in M1 to the 64-bit values in M2. */ +#ifdef __SSE2__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_si64 (__m64 __m1, __m64 __m2); +#endif + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using signed + saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubsb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubsb (__m64 __m1, __m64 __m2) +{ + return _mm_subs_pi8 (__m1, __m2); +} + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + signed saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubsw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubsw (__m64 __m1, __m64 __m2) +{ + return _mm_subs_pi16 (__m1, __m2); +} + +/* Subtract the 8-bit values in M2 from the 8-bit values in M1 using + unsigned saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pu8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubusb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubusb (__m64 __m1, __m64 __m2) +{ + return _mm_subs_pu8 (__m1, __m2); +} + +/* Subtract the 16-bit values in M2 from the 16-bit values in M1 using + unsigned saturating arithmetic. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_subs_pu16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_psubusw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psubusw (__m64 __m1, __m64 __m2) +{ + return _mm_subs_pu16 (__m1, __m2); +} + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 producing + four 32-bit intermediate results, which are then summed by pairs to + produce two 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_madd_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pmaddwd ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaddwd (__m64 __m1, __m64 __m2) +{ + return _mm_madd_pi16 (__m1, __m2); +} + +/* Multiply four signed 16-bit values in M1 by four signed 16-bit values in + M2 and produce the high 16 bits of the 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pmulhw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmulhw (__m64 __m1, __m64 __m2) +{ + return _mm_mulhi_pi16 (__m1, __m2); +} + +/* Multiply four 16-bit values in M1 by four 16-bit values in M2 and produce + the low 16 bits of the results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mullo_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmullw (__m64 __m1, __m64 __m2) +{ + return _mm_mullo_pi16 (__m1, __m2); +} + +/* Shift four 16-bit values in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_pi16 (__m64 __m, __m64 __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllw (__m64 __m, __m64 __count) +{ + return _mm_sll_pi16 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_pi16 (__m64 __m, int __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllwi (__m64 __m, int __count) +{ + return _mm_slli_pi16 (__m, __count); +} + +/* Shift two 32-bit values in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_pi32 (__m64 __m, __m64 __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pslld (__m64 __m, __m64 __count) +{ + return _mm_sll_pi32 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_pi32 (__m64 __m, int __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pslldi (__m64 __m, int __count) +{ + return _mm_slli_pi32 (__m, __count); +} + +/* Shift the 64-bit value in M left by COUNT. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sll_si64 (__m64 __m, __m64 __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllq (__m64 __m, __m64 __count) +{ + return _mm_sll_si64 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_slli_si64 (__m64 __m, int __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psllqi (__m64 __m, int __count) +{ + return _mm_slli_si64 (__m, __count); +} + +/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_pi16 (__m64 __m, __m64 __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psraw (__m64 __m, __m64 __count) +{ + return _mm_sra_pi16 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_pi16 (__m64 __m, int __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrawi (__m64 __m, int __count) +{ + return _mm_srai_pi16 (__m, __count); +} + +/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sra_pi32 (__m64 __m, __m64 __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrad (__m64 __m, __m64 __count) +{ + return _mm_sra_pi32 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srai_pi32 (__m64 __m, int __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psradi (__m64 __m, int __count) +{ + return _mm_srai_pi32 (__m, __count); +} + +/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_pi16 (__m64 __m, __m64 __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlw (__m64 __m, __m64 __count) +{ + return _mm_srl_pi16 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_pi16 (__m64 __m, int __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlwi (__m64 __m, int __count) +{ + return _mm_srli_pi16 (__m, __count); +} + +/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_pi32 (__m64 __m, __m64 __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrld (__m64 __m, __m64 __count) +{ + return _mm_srl_pi32 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_pi32 (__m64 __m, int __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrldi (__m64 __m, int __count) +{ + return _mm_srli_pi32 (__m, __count); +} + +/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srl_si64 (__m64 __m, __m64 __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlq (__m64 __m, __m64 __count) +{ + return _mm_srl_si64 (__m, __count); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_srli_si64 (__m64 __m, int __count); + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psrlqi (__m64 __m, int __count) +{ + return _mm_srli_si64 (__m, __count); +} + +/* Bit-wise AND the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_si64 (__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pand (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pand (__m64 __m1, __m64 __m2) +{ + return _mm_and_si64 (__m1, __m2); +} + +/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the + 64-bit value in M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_si64 (__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pandn (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pandn (__m64 __m1, __m64 __m2) +{ + return _mm_andnot_si64 (__m1, __m2); +} + +/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_si64 (__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_por (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_por (__m64 __m1, __m64 __m2) +{ + return _mm_or_si64 (__m1, __m2); +} + +/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_si64 (__m64 __m1, __m64 __m2) +{ + return __builtin_ia32_pxor (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pxor (__m64 __m1, __m64 __m2) +{ + return _mm_xor_si64 (__m1, __m2); +} + +/* Compare eight 8-bit values. The result of the comparison is 0xFF if the + test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqb (__m64 __m1, __m64 __m2) +{ + return _mm_cmpeq_pi8 (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtb (__m64 __m1, __m64 __m2) +{ + return _mm_cmpgt_pi8 (__m1, __m2); +} + +/* Compare four 16-bit values. The result of the comparison is 0xFFFF if + the test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqw (__m64 __m1, __m64 __m2) +{ + return _mm_cmpeq_pi16 (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtw (__m64 __m1, __m64 __m2) +{ + return _mm_cmpgt_pi16 (__m1, __m2); +} + +/* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if + the test is true and zero if false. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpeqd (__m64 __m1, __m64 __m2) +{ + return _mm_cmpeq_pi32 (__m1, __m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) +{ + return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pcmpgtd (__m64 __m1, __m64 __m2) +{ + return _mm_cmpgt_pi32 (__m1, __m2); +} + +/* Creates a 64-bit zero. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_si64 (void) +{ + return (__m64)0LL; +} + +/* Creates a vector of two 32-bit values; I0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi32 (int __i1, int __i0) +{ + return (__m64) __builtin_ia32_vec_init_v2si (__i0, __i1); +} + +/* Creates a vector of four 16-bit values; W0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) +{ + return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3); +} + +/* Creates a vector of eight 8-bit values; B0 is least significant. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_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); +} + +/* Similar, but with the arguments in reverse order. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi32 (int __i0, int __i1) +{ + return _mm_set_pi32 (__i1, __i0); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) +{ + return _mm_set_pi16 (__w3, __w2, __w1, __w0); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_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); +} + +/* Creates a vector of two 32-bit values, both elements containing I. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi32 (int __i) +{ + return _mm_set_pi32 (__i, __i); +} + +/* Creates a vector of four 16-bit values, all elements containing W. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi16 (short __w) +{ + return _mm_set_pi16 (__w, __w, __w, __w); +} + +/* Creates a vector of eight 8-bit values, all elements containing B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_pi8 (char __b) +{ + return _mm_set_pi8 (__b, __b, __b, __b, __b, __b, __b, __b); +} + +#endif /* __MMX__ */ +#endif /* _MMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/4.6/xmmintrin.h b/GCC_XML/Support/GCC/4.6/xmmintrin.h new file mode 100644 index 0000000..06a150e --- /dev/null +++ b/GCC_XML/Support/GCC/4.6/xmmintrin.h @@ -0,0 +1,1239 @@ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 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 + . */ + +/* Implemented from the specification included in the Intel C++ Compiler + User Guide and Reference, version 9.0. */ + +#ifndef _XMMINTRIN_H_INCLUDED +#define _XMMINTRIN_H_INCLUDED + +#ifndef __SSE__ +# error "SSE instruction set not enabled" +#else + +/* We need type definitions from the MMX header file. */ +#include + +/* Get _mm_malloc () and _mm_free (). */ +#include + +/* The Intel API is flexible enough that we must allow aliasing with other + vector types, and their scalar components. */ +typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); + +/* Internal data types for implementing the intrinsics. */ +typedef float __v4sf __attribute__ ((__vector_size__ (16))); + +/* Create a selector for use with the SHUFPS instruction. */ +#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ + (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) + +/* Constants for use with _mm_prefetch. */ +enum _mm_hint +{ + _MM_HINT_T0 = 3, + _MM_HINT_T1 = 2, + _MM_HINT_T2 = 1, + _MM_HINT_NTA = 0 +}; + +/* Bits in the MXCSR. */ +#define _MM_EXCEPT_MASK 0x003f +#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_MASK_MASK 0x1f80 +#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_ROUND_MASK 0x6000 +#define _MM_ROUND_NEAREST 0x0000 +#define _MM_ROUND_DOWN 0x2000 +#define _MM_ROUND_UP 0x4000 +#define _MM_ROUND_TOWARD_ZERO 0x6000 + +#define _MM_FLUSH_ZERO_MASK 0x8000 +#define _MM_FLUSH_ZERO_ON 0x8000 +#define _MM_FLUSH_ZERO_OFF 0x0000 + +/* Create a vector of zeros. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setzero_ps (void) +{ + return __extension__ (__m128){ 0.0f, 0.0f, 0.0f, 0.0f }; +} + +/* Perform the respective operation on the lower SPFP (single-precision + floating-point) values of A and B; the upper three SPFP values are + passed through from A. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_addss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_subss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_mulss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_divss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_ss (__m128 __A) +{ + return (__m128) __builtin_ia32_sqrtss ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rcp_ss (__m128 __A) +{ + return (__m128) __builtin_ia32_rcpss ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rsqrt_ss (__m128 __A) +{ + return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_minss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_maxss ((__v4sf)__A, (__v4sf)__B); +} + +/* Perform the respective operation on the four SPFP values in A and B. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_add_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_addps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sub_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_subps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mul_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_mulps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_div_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_divps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sqrt_ps (__m128 __A) +{ + return (__m128) __builtin_ia32_sqrtps ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rcp_ps (__m128 __A) +{ + return (__m128) __builtin_ia32_rcpps ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_rsqrt_ps (__m128 __A) +{ + return (__m128) __builtin_ia32_rsqrtps ((__v4sf)__A); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_minps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_maxps ((__v4sf)__A, (__v4sf)__B); +} + +/* Perform logical bit-wise operations on 128-bit values. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_and_ps (__m128 __A, __m128 __B) +{ + return __builtin_ia32_andps (__A, __B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_andnot_ps (__m128 __A, __m128 __B) +{ + return __builtin_ia32_andnps (__A, __B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_or_ps (__m128 __A, __m128 __B) +{ + return __builtin_ia32_orps (__A, __B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_xor_ps (__m128 __A, __m128 __B) +{ + return __builtin_ia32_xorps (__A, __B); +} + +/* Perform a comparison on the lower SPFP values of A and B. If the + comparison is true, place a mask of all ones in the result, otherwise a + mask of zeros. The upper three SPFP values are passed through from A. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpeqss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpltss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpless ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf) __A, + (__v4sf) + __builtin_ia32_cmpltss ((__v4sf) __B, + (__v4sf) + __A)); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf) __A, + (__v4sf) + __builtin_ia32_cmpless ((__v4sf) __B, + (__v4sf) + __A)); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpneqss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpnltss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpnless ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf) __A, + (__v4sf) + __builtin_ia32_cmpnltss ((__v4sf) __B, + (__v4sf) + __A)); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf) __A, + (__v4sf) + __builtin_ia32_cmpnless ((__v4sf) __B, + (__v4sf) + __A)); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpordss ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpunordss ((__v4sf)__A, (__v4sf)__B); +} + +/* Perform a comparison on the four SPFP values of A and B. For each + element, if the comparison is true, place a mask of all ones in the + result, otherwise a mask of zeros. */ + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpeq_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpeqps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmplt_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpltps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmple_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpleps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpgt_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpgtps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpge_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpgeps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpneq_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpneqps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnlt_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpnltps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnle_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpnleps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpngt_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpngtps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpnge_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpngeps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpord_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpordps ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cmpunord_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_cmpunordps ((__v4sf)__A, (__v4sf)__B); +} + +/* Compare the lower SPFP values of A and B and return 1 if true + and 0 if false. */ + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comieq_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comieq ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comilt_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comilt ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comile_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comile ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comigt_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comigt ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comige_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comige ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_comineq_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_comineq ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomieq_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomieq ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomilt_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomilt ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomile_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomile ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomigt_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomigt ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomige_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomige ((__v4sf)__A, (__v4sf)__B); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_ucomineq_ss (__m128 __A, __m128 __B) +{ + return __builtin_ia32_ucomineq ((__v4sf)__A, (__v4sf)__B); +} + +/* Convert the lower SPFP value to a 32-bit integer according to the current + rounding mode. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si32 (__m128 __A) +{ + return __builtin_ia32_cvtss2si ((__v4sf) __A); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_ss2si (__m128 __A) +{ + return _mm_cvtss_si32 (__A); +} + +#ifdef __x86_64__ +/* Convert the lower SPFP value to a 32-bit integer according to the + current rounding mode. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si64 (__m128 __A) +{ + return __builtin_ia32_cvtss2si64 ((__v4sf) __A); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_si64x (__m128 __A) +{ + return __builtin_ia32_cvtss2si64 ((__v4sf) __A); +} +#endif + +/* Convert the two lower SPFP values to 32-bit integers according to the + current rounding mode. Return the integers in packed form. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi32 (__m128 __A) +{ + return (__m64) __builtin_ia32_cvtps2pi ((__v4sf) __A); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_ps2pi (__m128 __A) +{ + return _mm_cvtps_pi32 (__A); +} + +/* Truncate the lower SPFP value to a 32-bit integer. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si32 (__m128 __A) +{ + return __builtin_ia32_cvttss2si ((__v4sf) __A); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtt_ss2si (__m128 __A) +{ + return _mm_cvttss_si32 (__A); +} + +#ifdef __x86_64__ +/* Truncate the lower SPFP value to a 32-bit integer. */ + +/* Intel intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si64 (__m128 __A) +{ + return __builtin_ia32_cvttss2si64 ((__v4sf) __A); +} + +/* Microsoft intrinsic. */ +extern __inline long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttss_si64x (__m128 __A) +{ + return __builtin_ia32_cvttss2si64 ((__v4sf) __A); +} +#endif + +/* Truncate the two lower SPFP values to 32-bit integers. Return the + integers in packed form. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvttps_pi32 (__m128 __A) +{ + return (__m64) __builtin_ia32_cvttps2pi ((__v4sf) __A); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtt_ps2pi (__m128 __A) +{ + return _mm_cvttps_pi32 (__A); +} + +/* Convert B to a SPFP value and insert it as element zero in A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi32_ss (__m128 __A, int __B) +{ + return (__m128) __builtin_ia32_cvtsi2ss ((__v4sf) __A, __B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_si2ss (__m128 __A, int __B) +{ + return _mm_cvtsi32_ss (__A, __B); +} + +#ifdef __x86_64__ +/* Convert B to a SPFP value and insert it as element zero in A. */ + +/* Intel intrinsic. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64_ss (__m128 __A, long long __B) +{ + return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); +} + +/* Microsoft intrinsic. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsi64x_ss (__m128 __A, long long __B) +{ + return (__m128) __builtin_ia32_cvtsi642ss ((__v4sf) __A, __B); +} +#endif + +/* Convert the two 32-bit values in B to SPFP form and insert them + as the two lower elements in A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32_ps (__m128 __A, __m64 __B) +{ + return (__m128) __builtin_ia32_cvtpi2ps ((__v4sf) __A, (__v2si)__B); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvt_pi2ps (__m128 __A, __m64 __B) +{ + return _mm_cvtpi32_ps (__A, __B); +} + +/* Convert the four signed 16-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi16_ps (__m64 __A) +{ + __v4hi __sign; + __v2si __hisi, __losi; + __v4sf __zero, __ra, __rb; + + /* This comparison against zero gives us a mask that can be used to + fill in the missing sign bits in the unpack operations below, so + that we get signed values after unpacking. */ + __sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A); + + /* Convert the four words to doublewords. */ + __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign); + __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign); + + /* Convert the doublewords to floating point two at a time. */ + __zero = (__v4sf) _mm_setzero_ps (); + __ra = __builtin_ia32_cvtpi2ps (__zero, __losi); + __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi); + + return (__m128) __builtin_ia32_movlhps (__ra, __rb); +} + +/* Convert the four unsigned 16-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpu16_ps (__m64 __A) +{ + __v2si __hisi, __losi; + __v4sf __zero, __ra, __rb; + + /* Convert the four words to doublewords. */ + __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL); + __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL); + + /* Convert the doublewords to floating point two at a time. */ + __zero = (__v4sf) _mm_setzero_ps (); + __ra = __builtin_ia32_cvtpi2ps (__zero, __losi); + __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi); + + return (__m128) __builtin_ia32_movlhps (__ra, __rb); +} + +/* Convert the low four signed 8-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi8_ps (__m64 __A) +{ + __v8qi __sign; + + /* This comparison against zero gives us a mask that can be used to + fill in the missing sign bits in the unpack operations below, so + that we get signed values after unpacking. */ + __sign = __builtin_ia32_pcmpgtb ((__v8qi)0LL, (__v8qi)__A); + + /* Convert the four low bytes to words. */ + __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, __sign); + + return _mm_cvtpi16_ps(__A); +} + +/* Convert the low four unsigned 8-bit values in A to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpu8_ps(__m64 __A) +{ + __A = (__m64) __builtin_ia32_punpcklbw ((__v8qi)__A, (__v8qi)0LL); + return _mm_cvtpu16_ps(__A); +} + +/* Convert the four signed 32-bit values in A and B to SPFP form. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpi32x2_ps(__m64 __A, __m64 __B) +{ + __v4sf __zero = (__v4sf) _mm_setzero_ps (); + __v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A); + __v4sf __sfb = __builtin_ia32_cvtpi2ps (__sfa, (__v2si)__B); + return (__m128) __builtin_ia32_movlhps (__sfa, __sfb); +} + +/* Convert the four SPFP values in A to four signed 16-bit integers. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi16(__m128 __A) +{ + __v4sf __hisf = (__v4sf)__A; + __v4sf __losf = __builtin_ia32_movhlps (__hisf, __hisf); + __v2si __hisi = __builtin_ia32_cvtps2pi (__hisf); + __v2si __losi = __builtin_ia32_cvtps2pi (__losf); + return (__m64) __builtin_ia32_packssdw (__hisi, __losi); +} + +/* Convert the four SPFP values in A to four signed 8-bit integers. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtps_pi8(__m128 __A) +{ + __v4hi __tmp = (__v4hi) _mm_cvtps_pi16 (__A); + return (__m64) __builtin_ia32_packsswb (__tmp, (__v4hi)0LL); +} + +/* Selects four specific SPFP values from A and B based on MASK. */ +#ifdef __OPTIMIZE__ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_ps (__m128 __A, __m128 __B, int const __mask) +{ + return (__m128) __builtin_ia32_shufps ((__v4sf)__A, (__v4sf)__B, __mask); +} +#else +#define _mm_shuffle_ps(A, B, MASK) \ + ((__m128) __builtin_ia32_shufps ((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), (int)(MASK))) +#endif + +/* Selects and interleaves the upper two SPFP values from A and B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpackhi_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_unpckhps ((__v4sf)__A, (__v4sf)__B); +} + +/* Selects and interleaves the lower two SPFP values from A and B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_unpacklo_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_unpcklps ((__v4sf)__A, (__v4sf)__B); +} + +/* Sets the upper two SPFP values with 64-bits of data loaded from P; + the lower two values are passed through from A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadh_pi (__m128 __A, __m64 const *__P); + +/* Stores the upper two SPFP values of A into P. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeh_pi (__m64 *__P, __m128 __A); + +/* Moves the upper two values of B into the lower two values of A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movehl_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movhlps ((__v4sf)__A, (__v4sf)__B); +} + +/* Moves the lower two values of B into the upper two values of A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movelh_ps (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movlhps ((__v4sf)__A, (__v4sf)__B); +} + +/* Sets the lower two SPFP values with 64-bits of data loaded from P; + the upper two values are passed through from A. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadl_pi (__m128 __A, __m64 const *__P); + +/* Stores the lower two SPFP values of A into P. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storel_pi (__m64 *__P, __m128 __A); + +/* Creates a 4-bit mask from the most significant bits of the SPFP values. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_ps (__m128 __A) +{ + return __builtin_ia32_movmskps ((__v4sf)__A); +} + +/* Return the contents of the control register. */ +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_getcsr (void) +{ + return __builtin_ia32_stmxcsr (); +} + +/* Read exception bits from the control register. */ +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_EXCEPTION_STATE (void) +{ + return _mm_getcsr() & _MM_EXCEPT_MASK; +} + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_EXCEPTION_MASK (void) +{ + return _mm_getcsr() & _MM_MASK_MASK; +} + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_ROUNDING_MODE (void) +{ + return _mm_getcsr() & _MM_ROUND_MASK; +} + +extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_GET_FLUSH_ZERO_MODE (void) +{ + return _mm_getcsr() & _MM_FLUSH_ZERO_MASK; +} + +/* Set the control register to I. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setcsr (unsigned int __I) +{ + __builtin_ia32_ldmxcsr (__I); +} + +/* Set exception bits in the control register. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_EXCEPTION_STATE(unsigned int __mask) +{ + _mm_setcsr((_mm_getcsr() & ~_MM_EXCEPT_MASK) | __mask); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_EXCEPTION_MASK (unsigned int __mask) +{ + _mm_setcsr((_mm_getcsr() & ~_MM_MASK_MASK) | __mask); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_ROUNDING_MODE (unsigned int __mode) +{ + _mm_setcsr((_mm_getcsr() & ~_MM_ROUND_MASK) | __mode); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_MM_SET_FLUSH_ZERO_MODE (unsigned int __mode) +{ + _mm_setcsr((_mm_getcsr() & ~_MM_FLUSH_ZERO_MASK) | __mode); +} + +/* Create a vector with element 0 as F and the rest zero. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ss (float __F) +{ + return __extension__ (__m128)(__v4sf){ __F, 0.0f, 0.0f, 0.0f }; +} + +/* Create a vector with all four elements equal to F. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set1_ps (float __F) +{ + return __extension__ (__m128)(__v4sf){ __F, __F, __F, __F }; +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ps1 (float __F) +{ + return _mm_set1_ps (__F); +} + +/* Create a vector with element 0 as *P and the rest zero. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ss (float const *__P) +{ + return _mm_set_ss (*__P); +} + +/* Create a vector with all four elements equal to *P. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load1_ps (float const *__P) +{ + return _mm_set1_ps (*__P); +} + +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ps1 (float const *__P) +{ + return _mm_load1_ps (__P); +} + +/* Load four SPFP values from P. The address must be 16-byte aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_load_ps (float const *__P) +{ + return (__m128) *(__v4sf *)__P; +} + +/* Load four SPFP values from P. The address need not be 16-byte aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_ps (float const *__P) +{ + return (__m128) __builtin_ia32_loadups (__P); +} + +/* Load four SPFP values in reverse order. The address must be aligned. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadr_ps (float const *__P) +{ + __v4sf __tmp = *(__v4sf *)__P; + return (__m128) __builtin_ia32_shufps (__tmp, __tmp, _MM_SHUFFLE (0,1,2,3)); +} + +/* Create the vector [Z Y X W]. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_set_ps (const float __Z, const float __Y, const float __X, const float __W) +{ + return __extension__ (__m128)(__v4sf){ __W, __X, __Y, __Z }; +} + +/* Create the vector [W X Y Z]. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_setr_ps (float __Z, float __Y, float __X, float __W) +{ + return __extension__ (__m128)(__v4sf){ __Z, __Y, __X, __W }; +} + +/* Stores the lower SPFP value. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ss (float *__P, __m128 __A) +{ + *__P = __builtin_ia32_vec_ext_v4sf ((__v4sf)__A, 0); +} + +extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtss_f32 (__m128 __A) +{ + return __builtin_ia32_vec_ext_v4sf ((__v4sf)__A, 0); +} + +/* Store four SPFP values. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ps (float *__P, __m128 __A) +{ + *(__v4sf *)__P = (__v4sf)__A; +} + +/* Store four SPFP values. The address need not be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_ps (float *__P, __m128 __A) +{ + __builtin_ia32_storeups (__P, (__v4sf)__A); +} + +/* Store the lower SPFP value across four words. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store1_ps (float *__P, __m128 __A) +{ + __v4sf __va = (__v4sf)__A; + __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,0,0,0)); + _mm_storeu_ps (__P, __tmp); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_store_ps1 (float *__P, __m128 __A) +{ + _mm_store1_ps (__P, __A); +} + +/* Store four SPFP values in reverse order. The address must be aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storer_ps (float *__P, __m128 __A) +{ + __v4sf __va = (__v4sf)__A; + __v4sf __tmp = __builtin_ia32_shufps (__va, __va, _MM_SHUFFLE (0,1,2,3)); + _mm_store_ps (__P, __tmp); +} + +/* Sets the low SPFP value of A from the low value of B. */ +extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_move_ss (__m128 __A, __m128 __B) +{ + return (__m128) __builtin_ia32_movss ((__v4sf)__A, (__v4sf)__B); +} + +/* Extracts one of the four words of A. The selector N must be immediate. */ +#ifdef __OPTIMIZE__ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_extract_pi16 (__m64 const __A, int const __N) +{ + return __builtin_ia32_vec_ext_v4hi ((__v4hi)__A, __N); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pextrw (__m64 const __A, int const __N) +{ + return _mm_extract_pi16 (__A, __N); +} +#else +#define _mm_extract_pi16(A, N) \ + ((int) __builtin_ia32_vec_ext_v4hi ((__v4hi)(__m64)(A), (int)(N))) + +#define _m_pextrw(A, N) _mm_extract_pi16(A, N) +#endif + +/* Inserts word D into one of four words of A. The selector N must be + immediate. */ +#ifdef __OPTIMIZE__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_insert_pi16 (__m64 const __A, int const __D, int const __N) +{ + return (__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)__A, __D, __N); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pinsrw (__m64 const __A, int const __D, int const __N) +{ + return _mm_insert_pi16 (__A, __D, __N); +} +#else +#define _mm_insert_pi16(A, D, N) \ + ((__m64) __builtin_ia32_vec_set_v4hi ((__v4hi)(__m64)(A), \ + (int)(D), (int)(N))) + +#define _m_pinsrw(A, D, N) _mm_insert_pi16(A, D, N) +#endif + +/* Compute the element-wise maximum of signed 16-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pi16 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pmaxsw ((__v4hi)__A, (__v4hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaxsw (__m64 __A, __m64 __B) +{ + return _mm_max_pi16 (__A, __B); +} + +/* Compute the element-wise maximum of unsigned 8-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_max_pu8 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pmaxub ((__v8qi)__A, (__v8qi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmaxub (__m64 __A, __m64 __B) +{ + return _mm_max_pu8 (__A, __B); +} + +/* Compute the element-wise minimum of signed 16-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pi16 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pminsw ((__v4hi)__A, (__v4hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pminsw (__m64 __A, __m64 __B) +{ + return _mm_min_pi16 (__A, __B); +} + +/* Compute the element-wise minimum of unsigned 8-bit values. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_min_pu8 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pminub ((__v8qi)__A, (__v8qi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pminub (__m64 __A, __m64 __B) +{ + return _mm_min_pu8 (__A, __B); +} + +/* Create an 8-bit mask of the signs of 8-bit values. */ +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_movemask_pi8 (__m64 __A) +{ + return __builtin_ia32_pmovmskb ((__v8qi)__A); +} + +extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmovmskb (__m64 __A) +{ + return _mm_movemask_pi8 (__A); +} + +/* Multiply four unsigned 16-bit values in A by four unsigned 16-bit values + in B and produce the high 16 bits of the 32-bit results. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mulhi_pu16 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pmulhuw ((__v4hi)__A, (__v4hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pmulhuw (__m64 __A, __m64 __B) +{ + return _mm_mulhi_pu16 (__A, __B); +} + +/* Return a combination of the four 16-bit values in A. The selector + must be an immediate. */ +#ifdef __OPTIMIZE__ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_shuffle_pi16 (__m64 __A, int const __N) +{ + return (__m64) __builtin_ia32_pshufw ((__v4hi)__A, __N); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pshufw (__m64 __A, int const __N) +{ + return _mm_shuffle_pi16 (__A, __N); +} +#else +#define _mm_shuffle_pi16(A, N) \ + ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N))) + +#define _m_pshufw(A, N) _mm_shuffle_pi16 (A, N) +#endif + +/* Conditionally store byte elements of A into P. The high bit of each + byte in the selector N determines whether the corresponding byte from + A is stored. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) +{ + __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P); +} + +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_maskmovq (__m64 __A, __m64 __N, char *__P) +{ + _mm_maskmove_si64 (__A, __N, __P); +} + +/* Compute the rounded averages of the unsigned 8-bit values in A and B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_pu8 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pavgb ((__v8qi)__A, (__v8qi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pavgb (__m64 __A, __m64 __B) +{ + return _mm_avg_pu8 (__A, __B); +} + +/* Compute the rounded averages of the unsigned 16-bit values in A and B. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_avg_pu16 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_pavgw ((__v4hi)__A, (__v4hi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_pavgw (__m64 __A, __m64 __B) +{ + return _mm_avg_pu16 (__A, __B); +} + +/* Compute the sum of the absolute differences of the unsigned 8-bit + values in A and B. Return the value in the lower 16-bit word; the + upper words are cleared. */ +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sad_pu8 (__m64 __A, __m64 __B) +{ + return (__m64) __builtin_ia32_psadbw ((__v8qi)__A, (__v8qi)__B); +} + +extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_m_psadbw (__m64 __A, __m64 __B) +{ + return _mm_sad_pu8 (__A, __B); +} + +/* Loads one cache line from address P to a location "closer" to the + processor. The selector I specifies the type of prefetch operation. */ +#ifdef __OPTIMIZE__ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_prefetch (const void *__P, enum _mm_hint __I) +{ + __builtin_prefetch (__P, 0, __I); +} +#else +#define _mm_prefetch(P, I) \ + __builtin_prefetch ((P), 0, (I)) +#endif + +/* Stores the data in A to the address P without polluting the caches. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_pi (__m64 *__P, __m64 __A) +{ + __builtin_ia32_movntq ((unsigned long long *)__P, (unsigned long long)__A); +} + +/* Likewise. The address must be 16-byte aligned. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_stream_ps (float *__P, __m128 __A) +{ + __builtin_ia32_movntps (__P, (__v4sf)__A); +} + +/* Guarantees that every preceding store is globally visible before + any subsequent store. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_sfence (void) +{ + __builtin_ia32_sfence (); +} + +/* The execution of the next instruction is delayed by an implementation + specific amount of time. The instruction does not modify the + architectural state. */ +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_pause (void) +{ + __asm__ __volatile__ ("rep; nop" : : ); +} + +/* Transpose the 4x4 matrix composed of row[0-3]. */ +#define _MM_TRANSPOSE4_PS(row0, row1, row2, row3) \ +do { \ + __v4sf __r0 = (row0), __r1 = (row1), __r2 = (row2), __r3 = (row3); \ + __v4sf __t0 = __builtin_ia32_unpcklps (__r0, __r1); \ + __v4sf __t1 = __builtin_ia32_unpcklps (__r2, __r3); \ + __v4sf __t2 = __builtin_ia32_unpckhps (__r0, __r1); \ + __v4sf __t3 = __builtin_ia32_unpckhps (__r2, __r3); \ + (row0) = __builtin_ia32_movlhps (__t0, __t1); \ + (row1) = __builtin_ia32_movhlps (__t1, __t0); \ + (row2) = __builtin_ia32_movlhps (__t2, __t3); \ + (row3) = __builtin_ia32_movhlps (__t3, __t2); \ +} while (0) + +/* For backward source compatibility. */ +#ifdef __SSE2__ +# include +#endif + +#endif /* __SSE__ */ +#endif /* _XMMINTRIN_H_INCLUDED */ diff --git a/GCC_XML/Support/GCC/COPYING.RUNTIME b/GCC_XML/Support/GCC/COPYING.RUNTIME new file mode 100644 index 0000000..e1b3c69 --- /dev/null +++ b/GCC_XML/Support/GCC/COPYING.RUNTIME @@ -0,0 +1,73 @@ +GCC RUNTIME LIBRARY EXCEPTION + +Version 3.1, 31 March 2009 + +Copyright (C) 2009 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +This GCC Runtime Library Exception ("Exception") is an additional +permission under section 7 of the GNU General Public License, version +3 ("GPLv3"). It applies to a given file (the "Runtime Library") that +bears a notice placed by the copyright holder of the file stating that +the file is governed by GPLv3 along with this Exception. + +When you use GCC to compile a program, GCC may combine portions of +certain GCC header files and runtime libraries with the compiled +program. The purpose of this Exception is to allow compilation of +non-GPL (including proprietary) programs to use, in this way, the +header files and runtime libraries covered by this Exception. + +0. Definitions. + +A file is an "Independent Module" if it either requires the Runtime +Library for execution after a Compilation Process, or makes use of an +interface provided by the Runtime Library, but is not otherwise based +on the Runtime Library. + +"GCC" means a version of the GNU Compiler Collection, with or without +modifications, governed by version 3 (or a specified later version) of +the GNU General Public License (GPL) with the option of using any +subsequent versions published by the FSF. + +"GPL-compatible Software" is software whose conditions of propagation, +modification and use would permit combination with GCC in accord with +the license of GCC. + +"Target Code" refers to output from any compiler for a real or virtual +target processor architecture, in executable form or suitable for +input to an assembler, loader, linker and/or execution +phase. Notwithstanding that, Target Code does not include data in any +format that is used as a compiler intermediate representation, or used +for producing a compiler intermediate representation. + +The "Compilation Process" transforms code entirely represented in +non-intermediate languages designed for human-written code, and/or in +Java Virtual Machine byte code, into Target Code. Thus, for example, +use of source code generators and preprocessors need not be considered +part of the Compilation Process, since the Compilation Process can be +understood as starting with the output of the generators or +preprocessors. + +A Compilation Process is "Eligible" if it is done using GCC, alone or +with other GPL-compatible software, or if it is done without using any +work based on GCC. For example, using non-GPL-compatible Software to +optimize any GCC intermediate representations would not qualify as an +Eligible Compilation Process. + +1. Grant of Additional Permission. + +You have permission to propagate a work of Target Code formed by +combining the Runtime Library with Independent Modules, even if such +propagation would otherwise violate the terms of GPLv3, provided that +all Target Code was generated by Eligible Compilation Processes. You +may then convey such a combination under terms of your choice, +consistent with the licensing of the Independent Modules. + +2. No Weakening of GCC Copyleft. + +The availability of this Exception does not imply any general +presumption that third-party software is unaffected by the copyleft +requirements of the license of GCC. + diff --git a/GCC_XML/Support/GCC/COPYING3 b/GCC_XML/Support/GCC/COPYING3 new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/GCC_XML/Support/GCC/COPYING3 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program 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 of the License, or + (at your option) any later version. + + This program 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/GCC_XML/VcInstall/CMakeLists.txt b/GCC_XML/VcInstall/CMakeLists.txt index dd77a3d..27feb26 100644 --- a/GCC_XML/VcInstall/CMakeLists.txt +++ b/GCC_XML/VcInstall/CMakeLists.txt @@ -39,6 +39,8 @@ ADD_CUSTOM_COMMAND( ${GCCXML_SOURCE_DIR}/VcInstall/vc9Include.patch ${GCCXML_SOURCE_DIR}/VcInstall/vc9PlatformSDK.patch ${GCCXML_SOURCE_DIR}/VcInstall/vc9sp1Include.patch + ${GCCXML_SOURCE_DIR}/VcInstall/vc10Include.patch + ${GCCXML_SOURCE_DIR}/VcInstall/vc10PlatformSDK.patch ) ADD_CUSTOM_TARGET(vcInstallPatch DEPENDS ${GCCXML_BINARY_DIR}/vcInstall_stamp.c) diff --git a/GCC_XML/VcInstall/vc10Include.patch b/GCC_XML/VcInstall/vc10Include.patch new file mode 100644 index 0000000..ad2b2c3 --- /dev/null +++ b/GCC_XML/VcInstall/vc10Include.patch @@ -0,0 +1,5070 @@ +Index: algorithm +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/algorithm,v +retrieving revision 1.1 +retrieving revision 1.3 +diff -c -3 -p -r1.1 -r1.3 +*** algorithm 18 Nov 2010 15:58:43 -0000 1.1 +--- algorithm 18 Nov 2010 18:36:00 -0000 1.3 +*************** +*** 9,14 **** +--- 9,49 ---- + #pragma warning(push,3) + #pragma warning(disable: 4244) + ++ /* ------------------------------------------------------------------------ */ ++ /* Forward declare these now because they are used as non-dependent names. */ ++ _STDEXT_BEGIN ++ template ++ inline _OutIt unchecked_remove_copy(_InIt _First, _InIt _Last, ++ _OutIt _Dest, const _Ty& _Val); ++ template ++ inline _OutIt unchecked_remove_copy_if(_InIt _First, _InIt _Last, ++ _OutIt _Dest, _Pr _Pred); ++ template ++ inline _OutIt unchecked_merge(_InIt1 _First1, _InIt1 _Last1, ++ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest); ++ template ++ inline _OutIt unchecked_merge(_InIt1 _First1, _InIt1 _Last1, ++ _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, ++ _Pr _Pred); ++ template ++ inline _BidIt3 _Unchecked_merge_backward(_BidIt1 _First1, _BidIt1 _Last1, ++ _BidIt2 _First2, _BidIt2 _Last2, ++ _BidIt3 _Dest); ++ template ++ inline _BidIt3 _Unchecked_merge_backward(_BidIt1 _First1, _BidIt1 _Last1, ++ _BidIt2 _First2, _BidIt2 _Last2, ++ _BidIt3 _Dest, _Pr _Pred); ++ template ++ inline void _Unchecked_chunked_merge(_BidIt _First, _BidIt _Last, ++ _OutIt _Dest, _Diff _Chunk, ++ _Diff _Count); ++ template ++ inline void _Unchecked_chunked_merge(_BidIt _First, _BidIt _Last, ++ _OutIt _Dest, _Diff _Chunk, ++ _Diff _Count, _Pr _Pred); ++ _STDEXT_END ++ /* ------------------------------------------------------------------------ */ ++ + _STD_BEGIN + // COMMON SORT PARAMETERS + const int _ISORT_MAX = 32; // maximum size for insertion sort +*************** template inline +--- 2453,2459 ---- + + *(_First + _Hole) = _Move(_Val); // drop _Val into final hole + } +! #endif /* Disabled for gccxml */ + template inline +*************** template inline +*** 2444,2450 **** + _Dist_type(_First), _Val_type(_First)); + } + } +! + // TEMPLATE FUNCTION push_heap WITH PRED + template inline + void _Pop_heap_0(_RanIt _First, _RanIt _Last, _Ty *) +--- 2564,2570 ---- + _Adjust_heap(_First, _Diff(0), _Diff(_Last - _First), + _Move(_Val)); + } +! #endif /* Disabled for gccxml */ + template inline + void _Pop_heap_0(_RanIt _First, _RanIt _Last, _Ty *) +*************** template inline +*** 2554,2560 **** + if (1 < _Last - _First) + _Pop_heap(_Unchecked(_First), _Unchecked(_Last)); + } +! + // TEMPLATE FUNCTION pop_heap WITH PRED + template inline +--- 2628,2634 ---- + _Adjust_heap(_First, _Diff(0), _Diff(_Last - _First), + _Move(_Val), _Pred); + } +! #endif /* Disabled for gccxml */ + template inline +Index: bitset +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/bitset,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** bitset 18 Nov 2010 15:58:43 -0000 1.1 +--- bitset 18 Nov 2010 18:35:33 -0000 1.2 +*************** private: +*** 478,483 **** +--- 478,484 ---- + + void _Trim() + { // clear any trailing bits in last word ++ #if 0 /* Disabled for gccxml */ + _Trim_if<_Bits % _Bitsperword != 0>(); + } + +*************** private: +*** 490,495 **** +--- 491,497 ---- + template<> + void _Trim_if() + { // no bits to trim, do nothing ++ #endif /* Disabled for gccxml */ + } + + __declspec(noreturn) void _Xinv() const +Index: crtdefs.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/crtdefs.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** crtdefs.h 18 Nov 2010 15:58:43 -0000 1.1 +--- crtdefs.h 18 Nov 2010 18:36:30 -0000 1.2 +*************** extern "C" { +*** 220,226 **** + #endif + + /* See note on use of deprecate at the top of this file */ +! #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) + + /* Define _CRT_INSECURE_DEPRECATE */ + /* See note on use of deprecate at the top of this file */ +--- 220,226 ---- + #endif + + /* See note on use of deprecate at the top of this file */ +! #define _CRT_DEPRECATE_TEXT(_Text) + + /* Define _CRT_INSECURE_DEPRECATE */ + /* See note on use of deprecate at the top of this file */ +Index: deque +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/deque,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** deque 18 Nov 2010 15:58:44 -0000 1.1 +--- deque 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 901,907 **** + + #define _PUSH_BACK_END \ + ++this->_Mysize +! + deque(_Myt&& _Right) + : _Mybase(_Right._Alval) + { // construct by moving _Right +--- 901,907 ---- + + #define _PUSH_BACK_END \ + ++this->_Mysize +! #if 0 /* Disabled for gccxml */ + deque(_Myt&& _Right) + : _Mybase(_Right._Alval) + { // construct by moving _Right +*************** public: +*** 1016,1022 **** + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + ~deque() + { // destroy the deque + _Tidy(); +--- 1016,1022 ---- + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + ~deque() + { // destroy the deque + _Tidy(); +*************** template inline + void swap(deque<_Ty, _Alloc>& _Left, deque<_Ty, _Alloc>&& _Right) +--- 1686,1692 ---- + { // swap _Left and _Right deques + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(deque<_Ty, _Alloc>& _Left, deque<_Ty, _Alloc>&& _Right) +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + template inline + bool operator==(const deque<_Ty, _Alloc>& _Left, +--- 1702,1708 ---- + typedef deque<_Ty, _Alloc> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + template inline + bool operator==(const deque<_Ty, _Alloc>& _Left, +Index: eh.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/eh.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** eh.h 18 Nov 2010 15:58:44 -0000 1.1 +--- eh.h 18 Nov 2010 18:37:20 -0000 1.2 +*************** +*** 27,32 **** +--- 27,35 ---- + #error "eh.h is only for C++!" + #endif + ++ namespace std { class type_info; } ++ using std::type_info; ++ + /* terminate_handler is the standard name; terminate_function is supported for historical reasons */ + #ifndef _M_CEE_PURE + typedef void (__cdecl *terminate_function)(); +Index: fstream +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/fstream,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** fstream 18 Nov 2010 15:58:44 -0000 1.1 +--- fstream 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 161,167 **** + : _Mysb(_Noinit) + { // construct uninitialized + } +! + basic_filebuf(_Myt&& _Right) + { // construct by copying _Right + _Init(_Right._Myfile, _Newfl); // match buffering styles +--- 161,167 ---- + : _Mysb(_Noinit) + { // construct uninitialized + } +! #if 0 /* Disabled for gccxml */ + basic_filebuf(_Myt&& _Right) + { // construct by copying _Right + _Init(_Right._Myfile, _Newfl); // match buffering styles +*************** public: +*** 183,189 **** + this->swap(_Right); + } + } +! + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 183,189 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 197,208 **** + _STD swap(_Myfile, _Right._Myfile); + } + } +! + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + enum _Initfl + { // reasons for a call to _Init + _Newfl, _Openfl, _Closefl}; +--- 197,208 ---- + _STD swap(_Myfile, _Right._Myfile); + } + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + enum _Initfl + { // reasons for a call to _Init + _Newfl, _Openfl, _Closefl}; +*************** template inline + void swap(basic_filebuf<_Elem, _Traits>& _Left, +--- 671,677 ---- + { // swap _Left and _Right basic_filebufs + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(basic_filebuf<_Elem, _Traits>& _Left, +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // TEMPLATE CLASS basic_ifstream + template +--- 689,695 ---- + typedef basic_filebuf<_Elem, _Traits> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS basic_ifstream + template +*************** public: +*** 763,769 **** + _Filebuffer(_File) + { // construct with specified C stream + } +! + basic_ifstream(_Myt&& _Right) + : _Mybase(&_Filebuffer) + { // construct by moving _Right +--- 763,769 ---- + _Filebuffer(_File) + { // construct with specified C stream + } +! #if 0 /* Disabled for gccxml */ + basic_ifstream(_Myt&& _Right) + : _Mybase(&_Filebuffer) + { // construct by moving _Right +*************** public: +*** 784,790 **** + this->swap(_Right); + } + } +! + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 784,790 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 793,799 **** + _Filebuffer.swap(_Right._Filebuffer); + } + } +! + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); +--- 793,799 ---- + _Filebuffer.swap(_Right._Filebuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); +*************** public: +*** 808,814 **** + else + _Myios::clear(); // added with C++0X + } +! + #if _HAS_CPP0X + void open(const wstring& _Str, + ios_base::openmode _Mode = ios_base::in, +--- 808,814 ---- + else + _Myios::clear(); // added with C++0X + } +! #endif /* Disabled for gccxml */ + #if _HAS_CPP0X + void open(const wstring& _Str, + ios_base::openmode _Mode = ios_base::in, +*************** template inline + void swap(basic_ifstream<_Elem, _Traits>& _Left, +--- 897,903 ---- + { // swap _Left and _Right basic_ifstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(basic_ifstream<_Elem, _Traits>& _Left, +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // TEMPLATE CLASS basic_ofstream + template +--- 915,921 ---- + typedef basic_ifstream<_Elem, _Traits> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS basic_ofstream + template +*************** public: +*** 989,995 **** + _Filebuffer(_File) + { // construct with specified C stream + } +! + basic_ofstream(_Myt&& _Right) + : _Mybase(&_Filebuffer) + { // construct by moving _Right +--- 989,995 ---- + _Filebuffer(_File) + { // construct with specified C stream + } +! #if 0 /* Disabled for gccxml */ + basic_ofstream(_Myt&& _Right) + : _Mybase(&_Filebuffer) + { // construct by moving _Right +*************** public: +*** 1010,1016 **** + this->swap(_Right); + } + } +! + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 1010,1016 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 1019,1030 **** + _Filebuffer.swap(_Right._Filebuffer); + } + } +! + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + void open(const wchar_t *_Filename, + ios_base::openmode _Mode = ios_base::out, + int _Prot = (int)ios_base::_Openprot) +--- 1019,1030 ---- + _Filebuffer.swap(_Right._Filebuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + void open(const wchar_t *_Filename, + ios_base::openmode _Mode = ios_base::out, + int _Prot = (int)ios_base::_Openprot) +*************** template inline + void swap(basic_ofstream<_Elem, _Traits>& _Left, +--- 1123,1129 ---- + { // swap _Left and _Right basic_ofstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(basic_ofstream<_Elem, _Traits>& _Left, +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // TEMPLATE CLASS basic_fstream + template +--- 1141,1147 ---- + typedef basic_ofstream<_Elem, _Traits> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS basic_fstream + template +*************** public: +*** 1220,1226 **** + _Filebuffer(_File) + { // construct with specified C stream + } +! + basic_fstream(_Myt&& _Right) + : _Mybase(&_Filebuffer) + { // construct by moving _Right +--- 1220,1226 ---- + _Filebuffer(_File) + { // construct with specified C stream + } +! #if 0 /* Disabled for gccxml */ + basic_fstream(_Myt&& _Right) + : _Mybase(&_Filebuffer) + { // construct by moving _Right +*************** public: +*** 1241,1247 **** + this->swap(_Right); + } + } +! + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 1241,1247 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 1250,1261 **** + _Filebuffer.swap(_Right._Filebuffer); + } + } +! + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + void open(const wchar_t *_Filename, + ios_base::openmode _Mode = ios_base::in | ios_base::out, + int _Prot = (int)ios_base::_Openprot) +--- 1250,1261 ---- + _Filebuffer.swap(_Right._Filebuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + void open(const wchar_t *_Filename, + ios_base::openmode _Mode = ios_base::in | ios_base::out, + int _Prot = (int)ios_base::_Openprot) +*************** template inline + void swap(basic_fstream<_Elem, _Traits>& _Left, +--- 1354,1360 ---- + { // swap _Left and _Right basic_fstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(basic_fstream<_Elem, _Traits>& _Left, +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + _STD_END + + #pragma warning(pop) +Index: functional +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/functional,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** functional 18 Nov 2010 15:58:44 -0000 1.1 +--- functional 18 Nov 2010 19:18:59 -0000 1.2 +*************** +*** 11,17 **** + #pragma push_macro("new") + #undef new + +! #if _HAS_TR1 + #include + #include + #include +--- 11,17 ---- + #pragma push_macro("new") + #undef new + +! #if _HAS_TR1 && 0 /* Disabled for gccxml */ + #include + #include + #include +Index: hash_map +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/hash_map,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** hash_map 18 Nov 2010 15:58:44 -0000 1.1 +--- hash_map 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 166,172 **** + _Mybase::operator=(_Right); + return (*this); + } +! + hash_map(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct map by moving _Right +--- 166,172 ---- + _Mybase::operator=(_Right); + return (*this); + } +! #if 0 /* Disabled for gccxml */ + hash_map(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct map by moving _Right +*************** public: +*** 188,204 **** + mapped_type())).first; + return ((*_Where).second); + } +! + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! + mapped_type& operator[](const key_type& _Keyval) + { // find element matching _Keyval or insert with default mapped + iterator _Where = this->lower_bound(_Keyval); +--- 188,204 ---- + mapped_type())).first; + return ((*_Where).second); + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! #endif /* Disabled for gccxml */ + mapped_type& operator[](const key_type& _Keyval) + { // find element matching _Keyval or insert with default mapped + iterator _Where = this->lower_bound(_Keyval); +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + } // namespace stdext + _STD_BEGIN + using stdext::hash_map; +*************** public: +*** 349,355 **** + _Mybase::operator=(_Right); + return (*this); + } +! + hash_multimap(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct map by moving _Right +--- 350,356 ---- + _Mybase::operator=(_Right); + return (*this); + } +! #if 0 /* Disabled for gccxml */ + hash_multimap(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct map by moving _Right +*************** public: +*** 375,391 **** + { // insert a {key, mapped} value, with hint + return (_Mybase::insert(_Where, _STD forward<_Valty>(_Val))); + } +! + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! + iterator insert(const value_type& _Val) + { // insert a {key, mapped} value + return (_Mybase::insert(_Val).first); +--- 376,392 ---- + { // insert a {key, mapped} value, with hint + return (_Mybase::insert(_Where, _STD forward<_Valty>(_Val))); + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! #endif /* Disabled for gccxml */ + iterator insert(const value_type& _Val) + { // insert a {key, mapped} value + return (_Mybase::insert(_Val).first); +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + } // namespace stdext + _STD_BEGIN + using stdext::hash_multimap; +Index: hash_set +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/hash_set,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** hash_set 18 Nov 2010 15:58:44 -0000 1.1 +--- hash_set 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 138,144 **** + _Mybase::operator=(_Right); + return (*this); + } +! + hash_set(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct set by moving _Right +--- 138,144 ---- + _Mybase::operator=(_Right); + return (*this); + } +! #if 0 /* Disabled for gccxml */ + hash_set(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct set by moving _Right +*************** public: +*** 149,164 **** + _Mybase::operator=(_STD move(_Right)); + return (*this); + } +! + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } + }; + + template inline +--- 170,176 ---- + { // swap _Left and _Right hash_sets + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + } // namespace stdext + _STD_BEGIN + using stdext::hash_set; +*************** public: +*** 277,283 **** + _Mybase::operator=(_Right); + return (*this); + } +! + hash_multiset(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct set by moving _Right +--- 279,285 ---- + _Mybase::operator=(_Right); + return (*this); + } +! #if 0 /* Disabled for gccxml */ + hash_multiset(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct set by moving _Right +*************** public: +*** 303,319 **** + { // insert a {key, mapped} value, with hint + return (_Mybase::insert(_Where, _STD forward<_Valty>(_Val))); + } +! + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! + iterator insert(const value_type& _Val) + { // insert a key value + return (_Mybase::insert(_Val).first); +--- 305,321 ---- + { // insert a {key, mapped} value, with hint + return (_Mybase::insert(_Where, _STD forward<_Valty>(_Val))); + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! #endif /* Disabled for gccxml */ + iterator insert(const value_type& _Val) + { // insert a key value + return (_Mybase::insert(_Val).first); +*************** template inline +--- 342,348 ---- + { // swap _Left and _Right hash_multisets + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + } // namespace stdext + _STD_BEGIN + using stdext::hash_multiset; +Index: ios +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/ios,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** ios 18 Nov 2010 15:58:44 -0000 1.1 +--- ios 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 125,131 **** + const _Ctype& _Ctype_fac = _USE(getloc(), _Ctype); + return (_Ctype_fac.widen(_Byte)); + } +! + void __CLR_OR_THIS_CALL move(_Myt&& _Right) + { // assign by moving _Right + if (this != &_Right) +--- 125,131 ---- + const _Ctype& _Ctype_fac = _USE(getloc(), _Ctype); + return (_Ctype_fac.widen(_Byte)); + } +! #if 0 /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL move(_Myt&& _Right) + { // assign by moving _Right + if (this != &_Right) +*************** public: +*** 135,141 **** + this->swap(_Right); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap all but rdbuf() with right + ios_base::swap(_Right); +--- 135,141 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap all but rdbuf() with right + ios_base::swap(_Right); +Index: istream +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/istream,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** istream 18 Nov 2010 15:58:44 -0000 1.1 +--- istream 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 38,44 **** + { // construct uninitialized + ios_base::_Addstd(this); + } +! + __CLR_OR_THIS_CALL basic_istream(_Myt&& _Right) + : _Chcount(_Right._Chcount) + { // construct by moving _Right +--- 38,44 ---- + { // construct uninitialized + ios_base::_Addstd(this); + } +! #if 0 /* Disabled for gccxml */ + __CLR_OR_THIS_CALL basic_istream(_Myt&& _Right) + : _Chcount(_Right._Chcount) + { // construct by moving _Right +*************** public: +*** 52,58 **** + this->swap(_Right); + return (*this); + } +! + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + _Myios::swap(_Right); +--- 52,58 ---- + this->swap(_Right); + return (*this); + } +! #endif /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + _Myios::swap(_Right); +*************** public: +*** 938,944 **** + _Myos(_Noinit, false) + { // construct from stream buffer pointer + } +! + __CLR_OR_THIS_CALL basic_iostream(_Myt&& _Right) + : _Myis(_Right.rdbuf(), false), + _Myos(_Noinit, false) +--- 938,944 ---- + _Myos(_Noinit, false) + { // construct from stream buffer pointer + } +! #if 0 /* Disabled for gccxml */ + __CLR_OR_THIS_CALL basic_iostream(_Myt&& _Right) + : _Myis(_Right.rdbuf(), false), + _Myos(_Noinit, false) +*************** public: +*** 952,958 **** + this->swap(_Right); + return (*this); + } +! + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 952,958 ---- + this->swap(_Right); + return (*this); + } +! #endif /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** template class _CRTIMP2_PURE basic_iostr +*** 980,986 **** + + + #endif /* defined(_DLL_CPPLIB) etc. */ +! + // EXTRACTORS + template inline +--- 980,986 ---- + + + #endif /* defined(_DLL_CPPLIB) etc. */ +! #if 0 /* Disabled for gccxml */ + // EXTRACTORS + template inline +*************** template inline +*** 1076,1082 **** + { // extract an unsigned char + return (_Istr >> (char&)_Ch); + } +! + template inline + basic_istream<_Elem, _Traits>& operator>>( +--- 1076,1082 ---- + { // extract an unsigned char + return (_Istr >> (char&)_Ch); + } +! #endif /* Disabled for gccxml */ + template inline + basic_istream<_Elem, _Traits>& operator>>( +*************** template inline +*** 1120,1126 **** + { // extract an unsigned char + return (_STD move(_Istr) >> (char&)_Ch); + } +! + template inline +--- 1120,1126 ---- + { // extract an unsigned char + return (_STD move(_Istr) >> (char&)_Ch); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template> _Val); + } +! + // MANIPULATORS + template inline +--- 1129,1135 ---- + { // extract from rvalue stream + return (_Istr >> _Val); + } +! #endif /* Disabled for gccxml */ + // MANIPULATORS + template inline +Index: iterator +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/iterator,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** iterator 18 Nov 2010 15:58:44 -0000 1.1 +--- iterator 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 31,43 **** + container->push_back(_Val); + return (*this); + } +! + _Myt& operator=(_Valty&& _Val) + { // push value into container + container->push_back(_STD forward<_Valty>(_Val)); + return (*this); + } +! + _Myt& operator*() + { // pretend to return designated value + return (*this); +--- 31,43 ---- + container->push_back(_Val); + return (*this); + } +! #if 0 /* Disabled for gccxml */ + _Myt& operator=(_Valty&& _Val) + { // push value into container + container->push_back(_STD forward<_Valty>(_Val)); + return (*this); + } +! #endif /* Disabled for gccxml */ + _Myt& operator*() + { // pretend to return designated value + return (*this); +*************** public: +*** 91,103 **** + container->push_front(_Val); + return (*this); + } +! + _Myt& operator=(_Valty&& _Val) + { // push value into container + container->push_front(_STD forward<_Valty>(_Val)); + return (*this); + } +! + _Myt& operator*() + { // pretend to return designated value + return (*this); +--- 91,103 ---- + container->push_front(_Val); + return (*this); + } +! #if 0 /* Disabled for gccxml */ + _Myt& operator=(_Valty&& _Val) + { // push value into container + container->push_front(_STD forward<_Valty>(_Val)); + return (*this); + } +! #endif /* Disabled for gccxml */ + _Myt& operator*() + { // pretend to return designated value + return (*this); +*************** public: +*** 152,165 **** + ++iter; + return (*this); + } +! + _Myt& operator=(_Valty&& _Val) + { // push value into container + iter = container->insert(iter, _STD forward<_Valty>(_Val)); + ++iter; + return (*this); + } +! + _Myt& operator*() + { // pretend to return designated value + return (*this); +--- 152,165 ---- + ++iter; + return (*this); + } +! #if 0 /* Disabled for gccxml */ + _Myt& operator=(_Valty&& _Val) + { // push value into container + iter = container->insert(iter, _STD forward<_Valty>(_Val)); + ++iter; + return (*this); + } +! #endif /* Disabled for gccxml */ + _Myt& operator*() + { // pretend to return designated value + return (*this); +*************** public: +*** 207,213 **** + typedef typename iterator_traits<_RanIt>::difference_type + difference_type; + typedef _RanIt pointer; +! typedef value_type&& reference; + typedef _RanIt iterator_type; + + move_iterator() +--- 207,213 ---- + typedef typename iterator_traits<_RanIt>::difference_type + difference_type; + typedef _RanIt pointer; +! typedef value_type& reference; + typedef _RanIt iterator_type; + + move_iterator() +*************** public: +*** 586,592 **** + checked_array_iterator(_Iterator _Array, _STD size_t _Size, _STD size_t _Index = 0) + : _Myarray(_Array), _Mysize(_Size), _Myindex(_Index) + { // construct with array, size, and optional index +! _SCL_SECURE_ALWAYS_VALIDATE(_Index <= _Size); + } + + _Iterator base() const +--- 586,592 ---- + checked_array_iterator(_Iterator _Array, _STD size_t _Size, _STD size_t _Index = 0) + : _Myarray(_Array), _Mysize(_Size), _Myindex(_Index) + { // construct with array, size, and optional index +! //_SCL_SECURE_ALWAYS_VALIDATE(_Index <= _Size); + } + + _Iterator base() const +Index: limits +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/limits,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** limits 18 Nov 2010 15:58:45 -0000 1.1 +--- limits 18 Nov 2010 18:40:56 -0000 1.2 +*************** struct _CRTIMP2_PURE _Num_base +*** 76,93 **** + _STCONS(int, radix, 0); + }; + + // TEMPLATE CLASS numeric_limits + template + class numeric_limits + : public _Num_base + { // numeric limits for arbitrary type _Ty (say little or nothing) + public: +! static _Ty (__CRTDECL min)() _THROW0() + { // return minimum value + return (_Ty(0)); + } + +! static _Ty (__CRTDECL max)() _THROW0() + { // return maximum value + return (_Ty(0)); + } +--- 76,95 ---- + _STCONS(int, radix, 0); + }; + ++ #define __GCCXML_AVOID_MACRO_EXPANSION ++ + // TEMPLATE CLASS numeric_limits + template + class numeric_limits + : public _Num_base + { // numeric limits for arbitrary type _Ty (say little or nothing) + public: +! static _Ty __CRTDECL min __GCCXML_AVOID_MACRO_EXPANSION() _THROW0() + { // return minimum value + return (_Ty(0)); + } + +! static _Ty __CRTDECL max __GCCXML_AVOID_MACRO_EXPANSION() _THROW0() + { // return maximum value + return (_Ty(0)); + } +Index: list +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/list,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** list 18 Nov 2010 15:58:45 -0000 1.1 +--- list 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 536,542 **** + + return (_Pnode); + } +! + template + _Nodeptr _Buynode(_Nodeptr _Next, + _Nodeptr _Prev, _Valty&& _Val) +--- 536,542 ---- + + return (_Pnode); + } +! #if 0 /* Disabled for gccxml */ + template + _Nodeptr _Buynode(_Nodeptr _Next, + _Nodeptr _Prev, _Valty&& _Val) +*************** public: +*** 555,561 **** + + return (_Pnode); + } +! + static _Nodepref _Nextnode(_Nodeptr _Pnode) + { // return reference to successor pointer in node + return ((_Nodepref)(*_Pnode)._Next); +--- 555,561 ---- + + return (_Pnode); + } +! #endif /* Disabled for gccxml */ + static _Nodepref _Nextnode(_Nodeptr _Pnode) + { // return reference to successor pointer in node + return ((_Nodepref)(*_Pnode)._Next); +*************** public: +*** 683,689 **** + _RERAISE; + _CATCH_END + } +! + list(_Myt&& _Right) + : _Mybase(_Right._Alval) + { // construct list by copying _Right +--- 683,689 ---- + _RERAISE; + _CATCH_END + } +! #if 0 /* Disabled for gccxml */ + list(_Myt&& _Right) + : _Mybase(_Right._Alval) + { // construct list by copying _Right +*************** public: +*** 764,770 **** + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + ~list() + { // destroy the object + _Tidy(); +--- 764,770 ---- + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + ~list() + { // destroy the object + _Tidy(); +*************** public: +*** 1455,1463 **** +--- 1455,1465 ---- + + else + { // different allocator, copy nodes then erase source ++ #if 0 /* Disabled for gccxml */ + for (const_iterator _Next = _First; _Next != _Last; ++_Next) + insert(_Where, (_Ty &&)*_Next); + _Right.erase(_First, _Last); ++ #endif /* Disabled for gccxml */ + } + } + +*************** template inline + void swap(list<_Ty, _Alloc>& _Left, list<_Ty, _Alloc>&& _Right) +--- 1551,1557 ---- + { // swap _Left and _Right lists + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(list<_Ty, _Alloc>& _Left, list<_Ty, _Alloc>&& _Right) +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + template inline + bool operator==(const list<_Ty, _Alloc>& _Left, +--- 1567,1573 ---- + typedef list<_Ty, _Alloc> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + template inline + bool operator==(const list<_Ty, _Alloc>& _Left, +Index: map +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/map,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** map 18 Nov 2010 15:58:45 -0000 1.1 +--- map 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 149,155 **** + _Mybase::operator=(_Right); + return (*this); + } +! + map(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct map by moving _Right +--- 149,155 ---- + _Mybase::operator=(_Right); + return (*this); + } +! #if 0 /* Disabled for gccxml */ + map(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct map by moving _Right +*************** public: +*** 172,188 **** + mapped_type())); + return ((*_Where).second); + } +! + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! + #if _HAS_CPP0X + + #else /* _HAS_CPP0X */ +--- 172,188 ---- + mapped_type())); + return ((*_Where).second); + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! #endif /* Disabled for gccxml */ + #if _HAS_CPP0X + + #else /* _HAS_CPP0X */ +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // TEMPLATE CLASS multimap + template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS multimap + template(_Val))); + } +! + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! + #if _HAS_CPP0X + + #else /* _HAS_CPP0X */ +--- 372,388 ---- + { // insert a {key, mapped} value, with hint + return (_Mybase::insert(_Where, _STD forward<_Valty>(_Val))); + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! #endif /* Disabled for gccxml */ + #if _HAS_CPP0X + + #else /* _HAS_CPP0X */ +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + _STD_END + #pragma warning(pop) + #pragma pack(pop) +Index: memory +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/memory,v +retrieving revision 1.1 +retrieving revision 1.3 +diff -c -3 -p -r1.1 -r1.3 +*** memory 18 Nov 2010 15:58:45 -0000 1.1 +--- memory 3 Feb 2011 14:54:35 -0000 1.3 +*************** template inline + _FwdIt _Uninitialized_move(_InIt _First, _InIt _Last, _FwdIt _Dest, + _Alloc& _Al) ++ #if 0 /* Disabled for gccxml */ + { // move [_First, _Last) to raw _Dest, using _Al + return (_Uninit_move(_First, _Last, _Dest, _Al, + _Val_type(_First), _Ptr_cat(_First, _Dest))); + } ++ #else ++ ; ++ #endif + + // TEMPLATE FUNCTION uninitialized_fill + template& operator=(_Ty&& _Val) + { // move or construct value into active buffer, and increment + if (_Pbuf->_Current < _Pbuf->_Hiwater) +--- 775,781 ---- + } + return (*this); + } +! #if 0 /* Disabled for gccxml */ + _Temp_iterator<_Ty>& operator=(_Ty&& _Val) + { // move or construct value into active buffer, and increment + if (_Pbuf->_Current < _Pbuf->_Hiwater) +*************** public: +*** 785,791 **** + } + return (*this); + } +! + _Temp_iterator<_Ty>& operator*() + { // pretend to return designated value + return (*this); +--- 789,795 ---- + } + return (*this); + } +! #endif /* Disabled for gccxml */ + _Temp_iterator<_Ty>& operator*() + { // pretend to return designated value + return (*this); +*************** public: +*** 1225,1231 **** + : _Ptr(0), _Rep(0) + { // construct + } +! + _Ptr_base(_Myt&& _Right) + : _Ptr(0), _Rep(0) + { // construct _Ptr_base object that takes resource from _Right +--- 1229,1235 ---- + : _Ptr(0), _Rep(0) + { // construct + } +! #if 0 /* Disabled for gccxml */ + _Ptr_base(_Myt&& _Right) + : _Ptr(0), _Rep(0) + { // construct _Ptr_base object that takes resource from _Right +*************** public: +*** 1251,1257 **** + if (this != &_Right) + _Swap(_Right); + } +! + long use_count() const + { // return use count + return (_Rep ? _Rep->_Use_count() : 0); +--- 1255,1261 ---- + if (this != &_Right) + _Swap(_Right); + } +! #endif /* Disabled for gccxml */ + long use_count() const + { // return use count + return (_Rep ? _Rep->_Use_count() : 0); +*************** public: +*** 1522,1528 **** + { // construct shared_ptr object for dynamic_pointer_cast + this->_Reset(_Other, _Tag); + } +! + shared_ptr(_Myt&& _Right) + : _Mybase(_STD forward<_Myt>(_Right)) + { // construct shared_ptr object that takes resource from _Right +--- 1526,1532 ---- + { // construct shared_ptr object for dynamic_pointer_cast + this->_Reset(_Other, _Tag); + } +! #if 0 /* Disabled for gccxml */ + shared_ptr(_Myt&& _Right) + : _Mybase(_STD forward<_Myt>(_Right)) + { // construct shared_ptr object that takes resource from _Right +*************** public: +*** 1535,1541 **** + : _Mybase(_STD forward >(_Right)) + { // construct shared_ptr object that takes resource from _Right + } +! + #if _HAS_CPP0X + template +--- 1539,1545 ---- + : _Mybase(_STD forward >(_Right)) + { // construct shared_ptr object that takes resource from _Right + } +! #endif /* Disabled for gccxml */ + #if _HAS_CPP0X + template +*************** public: +*** 1552,1558 **** + return (*this); + } + #endif /* _HAS_CPP0X */ +! + _Myt& operator=(_Myt&& _Right) + { // construct shared_ptr object that takes resource from _Right + shared_ptr(_STD move(_Right)).swap(*this); +--- 1556,1562 ---- + return (*this); + } + #endif /* _HAS_CPP0X */ +! #if 0 /* Disabled for gccxml */ + _Myt& operator=(_Myt&& _Right) + { // construct shared_ptr object that takes resource from _Right + shared_ptr(_STD move(_Right)).swap(*this); +*************** public: +*** 1570,1576 **** + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! + ~shared_ptr() + { // release resource + this->_Decref(); +--- 1574,1580 ---- + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! #endif /* Disabled for gccxml */ + ~shared_ptr() + { // release resource + this->_Decref(); +*************** template +*** 1771,1777 **** + { // swap _Left and _Right shared_ptrs + _Left.swap(_Right); + } +! + template + void swap(shared_ptr<_Ty>& _Left, + shared_ptr<_Ty>&& _Right) +--- 1775,1781 ---- + { // swap _Left and _Right shared_ptrs + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template + void swap(shared_ptr<_Ty>& _Left, + shared_ptr<_Ty>&& _Right) +*************** template +*** 1785,1791 **** + { // swap _Left and _Right shared_ptrs + _Right.swap(_Left); + } +! + template + shared_ptr<_Ty1> static_pointer_cast(const shared_ptr<_Ty2>& _Other) +--- 1789,1795 ---- + { // swap _Left and _Right shared_ptrs + _Right.swap(_Left); + } +! #endif /* Disabled for gccxml */ + template + shared_ptr<_Ty1> static_pointer_cast(const shared_ptr<_Ty2>& _Other) +*************** public: +*** 2238,2244 **** + : _Mybase(_Ptr, _Dt) + { // construct with pointer and (maybe const) deleter& + } +! + unique_ptr(pointer _Ptr, typename tr1::remove_reference<_Dx>::type&& _Dt) + : _Mybase(_Ptr, _STD move(_Dt)) + { // construct by moving deleter +--- 2242,2248 ---- + : _Mybase(_Ptr, _Dt) + { // construct with pointer and (maybe const) deleter& + } +! #if 0 /* Disabled for gccxml */ + unique_ptr(pointer _Ptr, typename tr1::remove_reference<_Dx>::type&& _Dt) + : _Mybase(_Ptr, _STD move(_Dt)) + { // construct by moving deleter +*************** public: +*** 2288,2294 **** + _Right.get_deleter()); + } + } +! + void swap(_Myt& _Right) + { // swap elements + _Swap_adl(this->_Myptr, _Right._Myptr); +--- 2292,2298 ---- + _Right.get_deleter()); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap elements + _Swap_adl(this->_Myptr, _Right._Myptr); +*************** public: +*** 2394,2399 **** +--- 2398,2404 ---- + } + + public: ++ #if 0 /* Disabled for gccxml */ + unique_ptr(pointer _Ptr, typename tr1::remove_reference<_Dx>::type&& _Dt) + : _Mybase(_Ptr, _STD move(_Dt)) + { // construct by moving deleter +*************** public: +*** 2436,2442 **** + _Right.get_deleter()); + } + } +! + #if defined(_NATIVE_NULLPTR_SUPPORTED) \ + && !defined(_DO_NOT_USE_NULLPTR_IN_STL) + unique_ptr(_STD nullptr_t) +--- 2441,2447 ---- + _Right.get_deleter()); + } + } +! #endif /* Disabled for gccxml */ + #if defined(_NATIVE_NULLPTR_SUPPORTED) \ + && !defined(_DO_NOT_USE_NULLPTR_IN_STL) + unique_ptr(_STD nullptr_t) +*************** template + void swap(unique_ptr<_Ty, _Dx>& _Left, +--- 2543,2549 ---- + { // swap _Left with _Right + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template + void swap(unique_ptr<_Ty, _Dx>& _Left, +*************** templateswap(_Right); + return (*this); + } +! + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 68,74 ---- + this->swap(_Right); + return (*this); + } +! #endif /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** template inline +*** 960,966 **** + { // insert an unsigned char + return (_Ostr << (char)_Ch); + } +! + template inline +--- 960,966 ---- + { // insert an unsigned char + return (_Ostr << (char)_Ch); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template inline +--- 969,975 ---- + { // insert to rvalue stream + return (_Ostr << _Val); + } +! #endif /* Disabled for gccxml */ + // MANIPULATORS + template inline +Index: queue +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/queue,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** queue 18 Nov 2010 15:58:45 -0000 1.1 +--- queue 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 44,50 **** + c = _Right.c; + return (*this); + } +! + queue(_Myt&& _Right) + : c(_STD move(_Right.c)) + { // construct by moving _Right +--- 44,50 ---- + c = _Right.c; + return (*this); + } +! #if 0 /* Disabled for gccxml */ + queue(_Myt&& _Right) + : c(_STD move(_Right.c)) + { // construct by moving _Right +*************** public: +*** 76,82 **** + { // exchange contents with movable _Right + c.swap(_STD move(_Right.c)); + } +! + bool empty() const + { // test if queue is empty + return (c.empty()); +--- 76,82 ---- + { // exchange contents with movable _Right + c.swap(_STD move(_Right.c)); + } +! #endif /* Disabled for gccxml */ + bool empty() const + { // test if queue is empty + return (c.empty()); +*************** template inline + void swap(queue<_Ty, _Container>& _Left, +--- 139,145 ---- + { // swap _Left and _Right queues + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(queue<_Ty, _Container>& _Left, +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + template inline + bool operator==(const queue<_Ty, _Container>& _Left, +--- 157,163 ---- + typedef queue<_Ty, _Container> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + template inline + bool operator==(const queue<_Ty, _Container>& _Left, +*************** public: +*** 270,276 **** + comp = _Right.comp; + return (*this); + } +! + priority_queue(_Myt&& _Right) + : c(_STD move(_Right.c)), comp(_STD move(_Right.comp)) + { // construct by moving _Right +--- 270,276 ---- + comp = _Right.comp; + return (*this); + } +! #if 0 /* Disabled for gccxml */ + priority_queue(_Myt&& _Right) + : c(_STD move(_Right.c)), comp(_STD move(_Right.comp)) + { // construct by moving _Right +*************** public: +*** 316,322 **** + c.swap(_STD move(_Right.c)); + _Swap_adl(comp, _Right.comp); + } +! + bool empty() const + { // test if queue is empty + return (c.empty()); +--- 316,322 ---- + c.swap(_STD move(_Right.c)); + _Swap_adl(comp, _Right.comp); + } +! #endif /* Disabled for gccxml */ + bool empty() const + { // test if queue is empty + return (c.empty()); +*************** template inline +--- 369,375 ---- + { // swap _Left and _Right queues + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template inline +--- 178,184 ---- + { // swap _Left and _Right sets + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // TEMPLATE CLASS multiset + template, +--- 198,204 ---- + typedef set<_Kty, _Pr, _Alloc> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS multiset + template, +*************** public: +*** 274,280 **** + _Mybase::operator=(_Right); + return (*this); + } +! + multiset(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct set by moving _Right +--- 274,280 ---- + _Mybase::operator=(_Right); + return (*this); + } +! #if 0 /* Disabled for gccxml */ + multiset(_Myt&& _Right) + : _Mybase(_STD move(_Right)) + { // construct set by moving _Right +*************** public: +*** 300,316 **** + { // insert a key value, with hint + return (_Mybase::insert(_Where, _STD forward<_Valty>(_Val))); + } +! + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! + #if _HAS_CPP0X + + #else /* _HAS_CPP0X */ +--- 300,316 ---- + { // insert a key value, with hint + return (_Mybase::insert(_Where, _STD forward<_Valty>(_Val))); + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // exchange contents with non-movable _Right + _Mybase::swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // exchange contents with movable _Right + _Mybase::swap(_STD move(_Right)); + } +! #endif /* Disabled for gccxml */ + #if _HAS_CPP0X + + #else /* _HAS_CPP0X */ +*************** template inline +--- 361,367 ---- + { // swap _Left and _Right multisets + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + _STD_END + #pragma warning(pop) + #pragma pack(pop) +Index: setjmp.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/setjmp.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** setjmp.h 18 Nov 2010 15:58:45 -0000 1.1 +--- setjmp.h 18 Nov 2010 18:43:33 -0000 1.2 +*************** int __cdecl setjmp(_Out_ jmp_buf _Buf); +*** 249,255 **** + #ifdef __cplusplus + extern "C" + { +! _CRTIMP __declspec(noreturn) void __cdecl longjmp(_In_ jmp_buf _Buf, _In_ int _Value) throw(...); + } + #else + _CRTIMP __declspec(noreturn) void __cdecl longjmp(_In_ jmp_buf _Buf, _In_ int _Value); +--- 249,255 ---- + #ifdef __cplusplus + extern "C" + { +! _CRTIMP __declspec(noreturn) void __cdecl longjmp(_In_ jmp_buf _Buf, _In_ int _Value); + } + #else + _CRTIMP __declspec(noreturn) void __cdecl longjmp(_In_ jmp_buf _Buf, _In_ int _Value); +Index: sstream +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/sstream,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** sstream 18 Nov 2010 15:58:45 -0000 1.1 +--- sstream 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 34,40 **** + { // construct character buffer from string, mode + _Init(_Str.c_str(), _Str.size(), _Getstate(_Mode)); + } +! + basic_stringbuf(_Myt&& _Right) + { // construct by moving _Right + _Assign_rv(_STD forward<_Myt>(_Right)); +--- 34,40 ---- + { // construct character buffer from string, mode + _Init(_Str.c_str(), _Str.size(), _Getstate(_Mode)); + } +! #if 0 /* Disabled for gccxml */ + basic_stringbuf(_Myt&& _Right) + { // construct by moving _Right + _Assign_rv(_STD forward<_Myt>(_Right)); +*************** public: +*** 54,60 **** + this->swap(_Right); + } + } +! + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 54,60 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 65,76 **** + _Swap_adl(_Al, _Right._Al); + } + } +! + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + virtual ~basic_stringbuf() + { // destroy the object + _Tidy(); +--- 65,76 ---- + _Swap_adl(_Al, _Right._Al); + } + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + virtual ~basic_stringbuf() + { // destroy the object + _Tidy(); +*************** template inline +--- 381,387 ---- + { // swap _Left and _Right basic_stringbufs + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // TEMPLATE CLASS basic_istringstream + template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS basic_istringstream + templateswap(_Right); + } + } +! + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 449,455 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 458,469 **** + _Stringbuffer.swap(_Right._Stringbuffer); + } + } +! + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + virtual ~basic_istringstream() + { // destroy the object + } +--- 458,469 ---- + _Stringbuffer.swap(_Right._Stringbuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + virtual ~basic_istringstream() + { // destroy the object + } +*************** template inline +--- 496,502 ---- + { // swap _Left and _Right basic_istringstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // TEMPLATE CLASS basic_ostringstream + template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS basic_ostringstream + templateswap(_Right); + } + } +! + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 564,570 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 573,584 **** + _Stringbuffer.swap(_Right._Stringbuffer); + } + } +! + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + virtual ~basic_ostringstream() + { // destroy the object + } +--- 573,584 ---- + _Stringbuffer.swap(_Right._Stringbuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + virtual ~basic_ostringstream() + { // destroy the object + } +*************** template inline +--- 611,617 ---- + { // swap _Left and _Right basic_ostringstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // TEMPLATE CLASS basic_stringstream + template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS basic_stringstream + templateswap(_Right); + } + } +! + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 685,691 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 694,705 **** + _Stringbuffer.swap(_Right._Stringbuffer); + } + } +! + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + virtual ~basic_stringstream() + { // destroy the object + } +--- 694,705 ---- + _Stringbuffer.swap(_Right._Stringbuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + virtual ~basic_stringstream() + { // destroy the object + } +*************** template inline +--- 732,738 ---- + { // swap _Left and _Right basic_stringstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + _STD_END + #pragma warning(pop) + #pragma pack(pop) +Index: stack +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/stack,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** stack 18 Nov 2010 15:58:45 -0000 1.1 +--- stack 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 41,47 **** + c = _Right.c; + return (*this); + } +! + stack(_Myt&& _Right) + : c(_STD move(_Right.c)) + { // construct by moving _Right +--- 41,47 ---- + c = _Right.c; + return (*this); + } +! #if 0 /* Disabled for gccxml */ + stack(_Myt&& _Right) + : c(_STD move(_Right.c)) + { // construct by moving _Right +*************** public: +*** 73,79 **** + { // exchange contents with movable _Right + c.swap(_STD move(_Right.c)); + } +! + bool empty() const + { // test if stack is empty + return (c.empty()); +--- 73,79 ---- + { // exchange contents with movable _Right + c.swap(_STD move(_Right.c)); + } +! #endif /* Disabled for gccxml */ + bool empty() const + { // test if stack is empty + return (c.empty()); +*************** template inline + void swap(stack<_Ty, _Container>& _Left, +--- 126,132 ---- + { // swap _Left and _Right stacks + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(stack<_Ty, _Container>& _Left, +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + template inline + bool operator==(const stack<_Ty, _Container>& _Left, +--- 144,150 ---- + typedef stack<_Ty, _Container> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + template inline + bool operator==(const stack<_Ty, _Container>& _Left, +Index: stddef.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/stddef.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** stddef.h 18 Nov 2010 15:58:45 -0000 1.1 +--- stddef.h 18 Nov 2010 18:39:02 -0000 1.2 +*************** errno_t __cdecl _get_errno(_Out_ int * _ +*** 52,57 **** +--- 52,59 ---- + #endif + + /* Define offsetof macro */ ++ #define offsetof(s,m) ((size_t)__builtin_offsetof(s,m)) ++ #if 0 /* replaced for gccxml */ + #ifdef __cplusplus + + #ifdef _WIN64 +*************** errno_t __cdecl _get_errno(_Out_ int * _ +*** 69,74 **** +--- 71,77 ---- + #endif + + #endif /* __cplusplus */ ++ #endif /* 0 */ + + _CRTIMP extern unsigned long __cdecl __threadid(void); + #define _threadid (__threadid()) +Index: string +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/string,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** string 18 Nov 2010 15:58:45 -0000 1.1 +--- string 18 Nov 2010 18:35:33 -0000 1.2 +*************** template inline +--- 82,88 ---- + _Ans += _Right; + return (_Ans); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template inline +--- 156,162 ---- + { // return string + character + return (_STD move(_Left.append(1, _Right))); + } +! #endif /* Disabled for gccxml */ + template inline +*************** template= NTCS + return (!(_Left < _Right)); + } +! + // basic_string INSERTERS AND EXTRACTORS + template= NTCS + return (!(_Left < _Right)); + } +! #if 0 /* Disabled for gccxml */ + // basic_string INSERTERS AND EXTRACTORS + template inline +--- 451,457 ---- + { // get characters into string, discard newline + return (getline(_Istr, _Str, _Istr.widen('\n'))); + } +! #endif /* Disabled for gccxml */ + template inline +Index: strstream +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/strstream,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** strstream 18 Nov 2010 15:58:45 -0000 1.1 +--- strstream 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 70,76 **** + } + + #pragma warning(pop) +! + __CLR_OR_THIS_CALL strstreambuf(_Myt&& _Right) + { // construct by moving _Right + _Init(); +--- 70,76 ---- + } + + #pragma warning(pop) +! #if 0 /* Disabled for gccxml */ + __CLR_OR_THIS_CALL strstreambuf(_Myt&& _Right) + { // construct by moving _Right + _Init(); +*************** public: +*** 91,97 **** + this->swap(_Right); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 91,97 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 105,116 **** + _STD swap(_Pfree, _Right._Pfree); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + virtual __CLR_OR_THIS_CALL ~strstreambuf() + { // destroy a strstreambuf + _Tidy(); +--- 105,116 ---- + _STD swap(_Pfree, _Right._Pfree); + } + } +! #if 0 /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + virtual __CLR_OR_THIS_CALL ~strstreambuf() + { // destroy a strstreambuf + _Tidy(); +*************** inline void swap(strstreambuf& _Left, st +*** 401,407 **** + { // swap _Left and _Right strstreambufs + _Left.swap(_Right); + } +! + inline void swap(strstreambuf& _Left, strstreambuf&& _Right) + { // swap _Left and _Right strstreambufs + typedef strstreambuf _Myt; +--- 401,407 ---- + { // swap _Left and _Right strstreambufs + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + inline void swap(strstreambuf& _Left, strstreambuf&& _Right) + { // swap _Left and _Right strstreambufs + typedef strstreambuf _Myt; +*************** inline void swap(strstreambuf&& _Left, s +*** 413,419 **** + typedef strstreambuf _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // CLASS istrstream + class istrstream + : public istream +--- 413,419 ---- + typedef strstreambuf _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // CLASS istrstream + class istrstream + : public istream +*************** public: +*** 444,450 **** + : _Mybase(&_Strbuffer), _Strbuffer((const char *)_Ptr, _Count) + { // construct with [_Ptr, _Ptr + _Count) + } +! + __CLR_OR_THIS_CALL istrstream(_Myt&& _Right) + : _Mybase(&_Strbuffer) + { // construct by moving _Right +--- 444,450 ---- + : _Mybase(&_Strbuffer), _Strbuffer((const char *)_Ptr, _Count) + { // construct with [_Ptr, _Ptr + _Count) + } +! #if 0 /* Disabled for gccxml */ + __CLR_OR_THIS_CALL istrstream(_Myt&& _Right) + : _Mybase(&_Strbuffer) + { // construct by moving _Right +*************** public: +*** 465,471 **** + this->swap(_Right); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 465,471 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 474,485 **** + _Strbuffer.swap(_Right._Strbuffer); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + virtual __CLR_OR_THIS_CALL ~istrstream() + { // destroy an istrstream + } +--- 474,485 ---- + _Strbuffer.swap(_Right._Strbuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + virtual __CLR_OR_THIS_CALL ~istrstream() + { // destroy an istrstream + } +*************** inline void swap(istrstream& _Left, istr +*** 503,509 **** + { // swap _Left and _Right istrstreams + _Left.swap(_Right); + } +! + inline void swap(istrstream& _Left, istrstream&& _Right) + { // swap _Left and _Right istrstreams + typedef istrstream _Myt; +--- 503,509 ---- + { // swap _Left and _Right istrstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + inline void swap(istrstream& _Left, istrstream&& _Right) + { // swap _Left and _Right istrstreams + typedef istrstream _Myt; +*************** inline void swap(istrstream&& _Left, ist +*** 515,521 **** + typedef istrstream _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // CLASS ostrstream + class ostrstream + : public ostream +--- 515,521 ---- + typedef istrstream _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // CLASS ostrstream + class ostrstream + : public ostream +*************** public: +*** 540,546 **** + ? _Ptr : _Ptr + _CSTD strlen(_Ptr)) + { // construct with [_Ptr, _Ptr + _Count) + } +! + __CLR_OR_THIS_CALL ostrstream(_Myt&& _Right) + : _Mybase(&_Strbuffer) + { // construct by moving _Right +--- 540,546 ---- + ? _Ptr : _Ptr + _CSTD strlen(_Ptr)) + { // construct with [_Ptr, _Ptr + _Count) + } +! #if 0 /* Disabled for gccxml */ + __CLR_OR_THIS_CALL ostrstream(_Myt&& _Right) + : _Mybase(&_Strbuffer) + { // construct by moving _Right +*************** public: +*** 561,567 **** + this->swap(_Right); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 561,567 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 570,581 **** + _Strbuffer.swap(_Right._Strbuffer); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + virtual __CLR_OR_THIS_CALL ~ostrstream() + { // destroy an ostrstream + } +--- 570,581 ---- + _Strbuffer.swap(_Right._Strbuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + virtual __CLR_OR_THIS_CALL ~ostrstream() + { // destroy an ostrstream + } +*************** inline void swap(ostrstream& _Left, ostr +*** 609,615 **** + { // swap _Left and _Right ostrstreams + _Left.swap(_Right); + } +! + inline void swap(ostrstream& _Left, ostrstream&& _Right) + { // swap _Left and _Right ostrstreams + typedef ostrstream _Myt; +--- 609,615 ---- + { // swap _Left and _Right ostrstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + inline void swap(ostrstream& _Left, ostrstream&& _Right) + { // swap _Left and _Right ostrstreams + typedef ostrstream _Myt; +*************** inline void swap(ostrstream&& _Left, ost +*** 621,627 **** + typedef ostrstream _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + // CLASS strstream + class strstream + : public iostream +--- 621,627 ---- + typedef ostrstream _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + // CLASS strstream + class strstream + : public iostream +*************** public: +*** 651,657 **** + ? _Ptr : _Ptr + _CSTD strlen(_Ptr)) + { // construct with [_Ptr, _Ptr + _Count) + } +! + __CLR_OR_THIS_CALL strstream(_Myt&& _Right) + : _Mybase(&_Strbuffer) + { // construct by moving _Right +--- 651,657 ---- + ? _Ptr : _Ptr + _CSTD strlen(_Ptr)) + { // construct with [_Ptr, _Ptr + _Count) + } +! #if 0 /* Disabled for gccxml */ + __CLR_OR_THIS_CALL strstream(_Myt&& _Right) + : _Mybase(&_Strbuffer) + { // construct by moving _Right +*************** public: +*** 672,678 **** + this->swap(_Right); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +--- 672,678 ---- + this->swap(_Right); + } + } +! #endif /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt& _Right) + { // swap with _Right + if (this != &_Right) +*************** public: +*** 681,692 **** + _Strbuffer.swap(_Right._Strbuffer); + } + } +! + void __CLR_OR_THIS_CALL swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + virtual __CLR_OR_THIS_CALL ~strstream() + { // destroy a strstream + } +--- 681,692 ---- + _Strbuffer.swap(_Right._Strbuffer); + } + } +! #if 0 /* Disabled for gccxml */ + void __CLR_OR_THIS_CALL swap(_Myt&& _Right) + { // swap with _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + virtual __CLR_OR_THIS_CALL ~strstream() + { // destroy a strstream + } +*************** inline void swap(strstream& _Left, strst +*** 720,726 **** + { // swap _Left and _Right strstreams + _Left.swap(_Right); + } +! + inline void swap(strstream& _Left, strstream&& _Right) + { // swap _Left and _Right strstreams + typedef strstream _Myt; +--- 720,726 ---- + { // swap _Left and _Right strstreams + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + inline void swap(strstream& _Left, strstream&& _Right) + { // swap _Left and _Right strstreams + typedef strstream _Myt; +*************** inline void swap(strstream&& _Left, strs +*** 732,737 **** +--- 732,738 ---- + typedef strstream _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } ++ #endif /* Disabled for gccxml */ + _STD_END + + #pragma pop_macro("new") +Index: type_traits +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/type_traits,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** type_traits 18 Nov 2010 15:58:45 -0000 1.1 +--- type_traits 18 Nov 2010 18:49:59 -0000 1.2 +*************** +*** 12,17 **** +--- 12,18 ---- + // COMPILER SUPPORT MACROS + + // VC++ V8 support ++ #if 0 /* Replaced for gccxml */ + #define _IS_BASE_OF(_Base, _Der) \ + : _Cat_base<__is_base_of(_Base, _Der)> + #define _IS_CONVERTIBLE(_From, _To) \ +*************** +*** 46,51 **** +--- 47,74 ---- + : _Cat_base::value || __has_nothrow_assign(_Ty)> + #define _HAS_VIRTUAL_DESTRUCTOR(_Ty) \ + : _Cat_base<__has_virtual_destructor(_Ty)> ++ #else /* Replaced for gccxml */ ++ #define _IS_BASE_OF(_Base, _Der) ++ #define _IS_CONVERTIBLE(_From, _To) ++ #define _IS_UNION(_Ty) ++ #define _IS_CLASS(_Ty) ++ #define _IS_ENUM(_Ty) ++ #define _IS_POD(_Ty) ++ #define _IS_EMPTY(_Ty) ++ #define _IS_POLYMORPHIC(_Ty) ++ #define _IS_ABSTRACT(_Ty) ++ #define _IS_STANDARD_LAYOUT(_Ty) ++ #define _IS_TRIVIAL(_Ty) ++ ++ #define _HAS_TRIVIAL_CONSTRUCTOR(_Ty) ++ #define _HAS_TRIVIAL_COPY(_Ty) ++ #define _HAS_TRIVIAL_ASSIGN(_Ty) ++ #define _HAS_TRIVIAL_DESTRUCTOR(_Ty) ++ #define _HAS_NOTHROW_CONSTRUCTOR(_Ty) ++ #define _HAS_NOTHROW_COPY(_Ty) ++ #define _HAS_NOTHROW_ASSIGN(_Ty) ++ #define _HAS_VIRTUAL_DESTRUCTOR(_Ty) ++ #endif /* Replaced for gccxml */ + + _STD_BEGIN + namespace tr1 { // TR1 additions +*************** template +*** 240,246 **** + template + struct add_rvalue_reference + { // add rvalue reference +! typedef _Ty && type; + }; + + template +--- 263,270 ---- + template + struct add_rvalue_reference + { // add rvalue reference +! // typedef _Ty && type; +! typedef _Ty & type; + }; + + template +*************** template +*** 422,434 **** + : false_type + { // determine whether _Ty is an rvalue reference + }; +! + template + struct is_rvalue_reference<_Ty&&> + : true_type + { // determine whether _Ty is an rvalue reference + }; +! + // TEMPLATE CLASS is_reference + template + struct is_reference +--- 446,458 ---- + : false_type + { // determine whether _Ty is an rvalue reference + }; +! #if 0 /* Disabled for gccxml */ + template + struct is_rvalue_reference<_Ty&&> + : true_type + { // determine whether _Ty is an rvalue reference + }; +! #endif /* Disabled for gccxml */ + // TEMPLATE CLASS is_reference + template + struct is_reference +Index: typeinfo +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/typeinfo,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** typeinfo 18 Nov 2010 15:58:45 -0000 1.1 +--- typeinfo 18 Nov 2010 18:37:20 -0000 1.2 +*************** struct __type_info_node { +*** 40,45 **** +--- 40,46 ---- + + extern __type_info_node __type_info_root_node; + ++ namespace std { + class type_info { + public: + #if _HAS_CPP0X +*************** private: +*** 74,79 **** +--- 75,82 ---- + _CRTIMP_PURE static const char *__CLRCALL_OR_CDECL _Name_base(const type_info *,__type_info_node* __ptype_info_node); + _CRTIMP_PURE static void __CLRCALL_OR_CDECL _Type_info_dtor(type_info *); + }; ++ } ++ using std::type_info; + + #if _HAS_EXCEPTIONS + +Index: utility +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/utility,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** utility 18 Nov 2010 15:58:45 -0000 1.1 +--- utility 18 Nov 2010 18:35:33 -0000 1.2 +*************** template +*** 71,77 **** + return (_Left); + } + }; +! + // TEMPLATE FUNCTION forward + template inline + _Ty&& forward(typename identity<_Ty>::type& _Arg) +--- 71,77 ---- + return (_Left); + } + }; +! #if 0 /* Disabled for gccxml */ + // TEMPLATE FUNCTION forward + template inline + _Ty&& forward(typename identity<_Ty>::type& _Arg) +*************** template inline +*** 94,107 **** + { // forward _Arg as movable + return ((typename tr1::_Remove_reference<_Ty>::_Type&&)_Arg); + } +! + // TEMPLATE FUNCTION swap (from ) + template inline + void swap(_Ty& _Left, _Ty& _Right) + { // exchange values stored at _Left and _Right + _Ty _Tmp = _Move(_Left); + _Left = _Move(_Right); + _Right = _Move(_Tmp); + } + + // TEMPLATE FUNCTION _Swap_adl +--- 94,109 ---- + { // forward _Arg as movable + return ((typename tr1::_Remove_reference<_Ty>::_Type&&)_Arg); + } +! #endif /* Disabled for gccxml */ + // TEMPLATE FUNCTION swap (from ) + template inline + void swap(_Ty& _Left, _Ty& _Right) + { // exchange values stored at _Left and _Right ++ #if 0 /* Disabled for gccxml */ + _Ty _Tmp = _Move(_Left); + _Left = _Move(_Right); + _Right = _Move(_Tmp); ++ #endif /* Disabled for gccxml */ + } + + // TEMPLATE FUNCTION _Swap_adl +*************** template::type _Ty1x; + typedef typename tr1::remove_reference<_Ty2>::type _Ty2x; +! + _Pair_base(_Ty1x&& _Val1, _Ty2x&& _Val2) + : first(_STD move(_Val1)), + second(_STD move(_Val2)) +--- 140,146 ---- + + typedef typename tr1::remove_reference<_Ty1>::type _Ty1x; + typedef typename tr1::remove_reference<_Ty2>::type _Ty2x; +! #if 0 /* Disabled for gccxml */ + _Pair_base(_Ty1x&& _Val1, _Ty2x&& _Val2) + : first(_STD move(_Val1)), + second(_STD move(_Val2)) +*************** template(_Val2)) + { // construct from moved values + } +! + _Ty1 first; // the first stored value + _Ty2 second; // the second stored value + }; +--- 164,170 ---- + second(_STD forward<_Other2>(_Val2)) + { // construct from moved values + } +! #endif /* Disabled for gccxml */ + _Ty1 first; // the first stored value + _Ty2 second; // the second stored value + }; +*************** template::type _Ty1x; + typedef typename tr1::remove_reference<_Ty2>::type _Ty2x; +! + pair(_Ty1x&& _Val1, _Ty2x&& _Val2) + : _Mybase(_STD move(_Val1), + _STD move(_Val2)) +--- 222,228 ---- + + typedef typename tr1::remove_reference<_Ty1>::type _Ty1x; + typedef typename tr1::remove_reference<_Ty2>::type _Ty2x; +! #if 0 /* Disabled for gccxml */ + pair(_Ty1x&& _Val1, _Ty2x&& _Val2) + : _Mybase(_STD move(_Val1), + _STD move(_Val2)) +*************** templatesecond = _STD move(_Right.second); + } + } ++ #endif /* Disabled for gccxml */ + }; + + // pair TEMPLATE FUNCTIONS +*************** template inline + void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>&& _Right) +--- 283,289 ---- + { // swap _Left and _Right pairs + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>&& _Right) +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + template inline + bool operator==(const pair<_Ty1, _Ty2>& _Left, +--- 299,305 ---- + typedef pair<_Ty1, _Ty2> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + template inline + bool operator==(const pair<_Ty1, _Ty2>& _Left, +*************** template inline + pair::type, +--- 350,356 ---- + } + + // TEMPLATE FUNCTION make_pair +! #if 0 /* Disabled for gccxml */ + template inline + pair::type, +*************** template(_Val1), + (typename _Unrefwrap<_Ty2>::type)_Val2)); + } +! + template inline + pair::type, +--- 386,392 ---- + return (_Mypair(_STD forward<_Ty1>(_Val1), + (typename _Unrefwrap<_Ty2>::type)_Val2)); + } +! #endif /* Disabled for gccxml */ + template inline + pair::type, +Index: valarray +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/valarray,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** valarray 18 Nov 2010 15:58:45 -0000 1.1 +--- valarray 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 101,107 **** + _Tidy(); + *this = _Indarr; + } +! + valarray(_Myt&& _Right) + { // construct by moving _Right + _Tidy(); +--- 101,107 ---- + _Tidy(); + *this = _Indarr; + } +! #if 0 /* Disabled for gccxml */ + valarray(_Myt&& _Right) + { // construct by moving _Right + _Tidy(); +*************** public: +*** 129,135 **** + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + void swap(_Myt& _Right) + { // exchange contents with _Right + if (this != &_Right) +--- 129,135 ---- + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + void swap(_Myt& _Right) + { // exchange contents with _Right + if (this != &_Right) +*************** private: +*** 444,451 **** +--- 444,453 ---- + _Myptr = _Allocate(_Newsize, (_Ty *)0); + + _TRY_BEGIN ++ #if 0 /* Disabled for gccxml */ + for (size_t _Idx = 0; _Idx < _Newsize; ++_Idx, _Ptr += _Inc) + _Construct(&_Myptr[_Idx], *_Ptr); ++ #endif /* Disabled for gccxml */ + _CATCH_ALL + _Tidy(true); // construction failed, clean up and reraise + _RERAISE; +*************** template inline +*** 479,485 **** + { // swap _Left and _Right valarrays + _Left.swap(_Right); + } +! + template inline + void swap(valarray<_Ty>& _Left, + valarray<_Ty>&& _Right) +--- 481,487 ---- + { // swap _Left and _Right valarrays + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(valarray<_Ty>& _Left, + valarray<_Ty>&& _Right) +*************** template inline +*** 495,501 **** + typedef valarray<_Ty> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + #if _HAS_CPP0X + template inline + _Ty *begin(valarray<_Ty>& _Array) +--- 497,503 ---- + typedef valarray<_Ty> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + #if _HAS_CPP0X + template inline + _Ty *begin(valarray<_Ty>& _Array) +Index: vector +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/vector,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** vector 18 Nov 2010 15:58:45 -0000 1.1 +--- vector 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 589,595 **** + _CATCH_END + } + } +! + vector(_Myt&& _Right) + : _Mybase(_Right._Alval) + { // construct by moving _Right +--- 589,595 ---- + _CATCH_END + } + } +! #if 0 /* Disabled for gccxml */ + vector(_Myt&& _Right) + : _Mybase(_Right._Alval) + { // construct by moving _Right +*************** public: +*** 699,705 **** + _Assign_rv(_STD forward<_Myt>(_Right)); + } + } +! + ~vector() + { // destroy the object + _Tidy(); +--- 699,705 ---- + _Assign_rv(_STD forward<_Myt>(_Right)); + } + } +! #endif /* Disabled for gccxml */ + ~vector() + { // destroy the object + _Tidy(); +*************** template inline + void swap(vector<_Ty, _Alloc>& _Left, vector<_Ty, _Alloc>&& _Right) +--- 1463,1469 ---- + { // swap _Left and _Right vectors + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline + void swap(vector<_Ty, _Alloc>& _Left, vector<_Ty, _Alloc>&& _Right) +*************** template _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! + template inline + bool operator==(const vector<_Ty, _Alloc>& _Left, +--- 1479,1485 ---- + typedef vector<_Ty, _Alloc> _Myt; + _Right.swap(_STD forward<_Myt>(_Left)); + } +! #endif /* Disabled for gccxml */ + template inline + bool operator==(const vector<_Ty, _Alloc>& _Left, +*************** public: +*** 2146,2152 **** + { // initialize from [_First, _Last), input iterators + insert(begin(), _First, _Last); + } +! + vector(_Myt&& _Right) + : _Mybase(0, false, _Right.get_allocator()) + { // construct by moving _Right +--- 2146,2152 ---- + { // initialize from [_First, _Last), input iterators + insert(begin(), _First, _Last); + } +! #if 0 /* Disabled for gccxml */ + vector(_Myt&& _Right) + : _Mybase(0, false, _Right.get_allocator()) + { // construct by moving _Right +*************** public: +*** 2179,2185 **** + { // exchange contents with movable _Right + _Assign_rv(_STD move(_Right)); + } +! + ~vector() + { // destroy the object + this->_Mysize = 0; +--- 2179,2185 ---- + { // exchange contents with movable _Right + _Assign_rv(_STD move(_Right)); + } +! #endif /* Disabled for gccxml */ + ~vector() + { // destroy the object + this->_Mysize = 0; +Index: xdebug +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xdebug,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xdebug 18 Nov 2010 15:58:45 -0000 1.1 +--- xdebug 18 Nov 2010 18:39:36 -0000 1.2 +*************** template +*** 56,62 **** +--- 56,64 ---- + { // delete from the debug CRT heap even if operator delete exists + if (_Ptr != 0) + { // worth deleting ++ #if 0 + _Ptr->~_Ty(); ++ #endif + // delete as _NORMAL_BLOCK, not _CRT_BLOCK, since we might have + // facets allocated by normal new. + free(_Ptr); +Index: xhash +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xhash,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xhash 18 Nov 2010 15:58:45 -0000 1.1 +--- xhash 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 241,247 **** + { // construct hash table by copying right + _Copy(_Right); + } +! + _Hash(_Myt&& _Right) + : _Traits(_Right.comp), + _List(_Right.get_allocator()), +--- 241,247 ---- + { // construct hash table by copying right + _Copy(_Right); + } +! #if 0 /* Disabled for gccxml */ + _Hash(_Myt&& _Right) + : _Traits(_Right.comp), + _List(_Right.get_allocator()), +*************** public: +*** 310,316 **** + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + ~_Hash() + { // destroy hash table + } +--- 310,316 ---- + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + ~_Hash() + { // destroy hash table + } +Index: xlocale +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xlocale,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xlocale 18 Nov 2010 15:58:45 -0000 1.1 +--- xlocale 18 Nov 2010 18:40:34 -0000 1.2 +*************** template +*** 55,60 **** +--- 55,62 ---- + class locale; + template + const _Facet& __CRTDECL use_facet(const locale&); ++ template ++ class collate; + + class locale + : public _Locbase +Index: xlocnum +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xlocnum,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xlocnum 18 Nov 2010 15:58:45 -0000 1.1 +--- xlocnum 18 Nov 2010 18:42:27 -0000 1.2 +*************** private: +*** 1493,1499 **** +--- 1493,1501 ---- + { // add a NUL to mark thousands separator + _Off -= *_Pg; + ++ #if 0 /* Disabled for gccxml */ + __analysis_assume(_Count + 1 > _Off); ++ #endif /* Disabled for gccxml */ + _CRT_SECURE_MEMMOVE(&_Buf[_Off + 1], _Count + 1 - _Off, + &_Buf[_Off], _Count + 1 - _Off); + +Index: xmemory +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xmemory,v +retrieving revision 1.1 +retrieving revision 1.3 +diff -c -3 -p -r1.1 -r1.3 +*** xmemory 18 Nov 2010 15:58:45 -0000 1.1 +--- xmemory 3 Feb 2011 14:54:34 -0000 1.3 +*************** template inline +*** 38,44 **** + + return ((_Ty _FARQ *)_Ptr); + } +! + // TEMPLATE FUNCTION _Construct + template inline +--- 38,44 ---- + + return ((_Ty _FARQ *)_Ptr); + } +! #if 0 /* Disabled for gccxml */ + // TEMPLATE FUNCTION _Construct + template inline +*************** template(_Val)); + } +! + template inline + void _Construct(_Ty1 _FARQ *_Ptr) + { // construct object at _Ptr with default value +--- 47,53 ---- + void _FARQ *_Vptr = _Ptr; + ::new (_Vptr) _Ty1(_STD forward<_Ty2>(_Val)); + } +! #endif /* Disabled for gccxml */ + template inline + void _Construct(_Ty1 _FARQ *_Ptr) + { // construct object at _Ptr with default value +*************** template<> inline +*** 84,92 **** +--- 84,96 ---- + template inline + void _Destroy_range(typename _Alloc::pointer _First, + typename _Alloc::pointer _Last, _Alloc& _Al) ++ #if 0 /* Disabled for gccxml */ + { // destroy [_First, _Last) + _Destroy_range(_First, _Last, _Al, _Ptr_cat(_First, _Last)); + } ++ #else ++ ; ++ #endif + + template inline + void _Destroy_range(typename _Alloc::pointer _First, +*************** public: +*** 196,202 **** + { // construct object at _Ptr with value _Val + _Construct(_Ptr, _Val); + } +! + void construct(pointer _Ptr, _Ty&& _Val) + { // construct object at _Ptr with value _Val + ::new ((void _FARQ *)_Ptr) _Ty(_STD forward<_Ty>(_Val)); +--- 200,206 ---- + { // construct object at _Ptr with value _Val + _Construct(_Ptr, _Val); + } +! #if 0 /* Disabled for gccxml */ + void construct(pointer _Ptr, _Ty&& _Val) + { // construct object at _Ptr with value _Val + ::new ((void _FARQ *)_Ptr) _Ty(_STD forward<_Ty>(_Val)); +*************** public: +*** 207,213 **** + { // construct object at _Ptr with value _Val + ::new ((void _FARQ *)_Ptr) _Ty(_STD forward<_Other>(_Val)); + } +! + void destroy(pointer _Ptr) + { // destroy object at _Ptr + _Destroy(_Ptr); +--- 211,217 ---- + { // construct object at _Ptr with value _Val + ::new ((void _FARQ *)_Ptr) _Ty(_STD forward<_Other>(_Val)); + } +! #endif /* Disabled for gccxml */ + void destroy(pointer _Ptr) + { // destroy object at _Ptr + _Destroy(_Ptr); +*************** template(_Src)); + } +! + template + void _Dest_val(_Alloc& _Alval, _Ty1 *_Pdest) +--- 283,292 ---- + { // construct using allocator + _Alval.construct(_Pdest, _STD forward<_Ty2>(_Src)); + } +! #else +! template +! void _Cons_val(_Alloc&, _Ty1 *, _Ty2 const&); +! #endif /* Disabled for gccxml */ + template + void _Dest_val(_Alloc& _Alval, _Ty1 *_Pdest) +Index: xstddef +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xstddef,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xstddef 18 Nov 2010 15:58:45 -0000 1.1 +--- xstddef 18 Nov 2010 18:43:04 -0000 1.2 +*************** _STD_BEGIN +*** 34,40 **** + #endif /* _THROWS */ + + #define _THROW0() throw () +! #define _THROW1(x) throw (...) + + #define _THROW(x, y) throw x(y) + #define _THROW_NCEE(x, y) throw x(y) +--- 34,40 ---- + #endif /* _THROWS */ + + #define _THROW0() throw () +! #define _THROW1(x) throw (x) + + #define _THROW(x, y) throw x(y) + #define _THROW_NCEE(x, y) throw x(y) +Index: xstring +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xstring,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xstring 18 Nov 2010 15:58:45 -0000 1.1 +--- xstring 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 696,702 **** + if (_First != _Last) + assign(&*_First, _Last - _First); + } +! + basic_string(_Myt&& _Right) + : _Mybase(_STD forward<_Alloc>(_Right._Alval)) + { // construct by moving _Right +--- 696,702 ---- + if (_First != _Last) + assign(&*_First, _Last - _First); + } +! #if 0 /* Disabled for gccxml */ + basic_string(_Myt&& _Right) + : _Mybase(_STD forward<_Alloc>(_Right._Alval)) + { // construct by moving _Right +*************** public: +*** 748,754 **** + assign(_STD forward<_Myt>(_Right)); + } + } +! + ~basic_string() + { // destroy the string + _Tidy(true); +--- 748,754 ---- + assign(_STD forward<_Myt>(_Right)); + } + } +! #endif /* Disabled for gccxml */ + ~basic_string() + { // destroy the string + _Tidy(true); +*************** template inline +--- 2040,2046 ---- + { // swap _Left and _Right strings + _Left.swap(_Right); + } +! #if 0 /* Disabled for gccxml */ + template inline +*************** template, allocator > + string; + typedef basic_string, allocator > +--- 2058,2064 ---- + { // swap _Left and _Right strings + _Right.swap(_Left); + } +! #endif /* Disabled for gccxml */ + typedef basic_string, allocator > + string; + typedef basic_string, allocator > +Index: xtr1common +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xtr1common,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xtr1common 18 Nov 2010 15:58:45 -0000 1.1 +--- xtr1common 18 Nov 2010 18:35:33 -0000 1.2 +*************** template +*** 350,375 **** + { // remove reference + typedef _Ty _Type; + }; +! + template + struct _Remove_reference<_Ty&&> + { // remove rvalue reference + typedef _Ty _Type; + }; +! + // TEMPLATE _Remove_rvalue_reference + template + struct _Remove_rvalue_reference + { // remove rvalue reference + typedef _Ty _Type; + }; +! + template + struct _Remove_rvalue_reference<_Ty&&> + { // remove rvalue reference + typedef _Ty _Type; + }; +! + // TEMPLATE STRUCT _Copy_cv + template +--- 350,375 ---- + { // remove reference + typedef _Ty _Type; + }; +! #if 0 /* Disabled for gccxml */ + template + struct _Remove_reference<_Ty&&> + { // remove rvalue reference + typedef _Ty _Type; + }; +! #endif /* Disabled for gccxml */ + // TEMPLATE _Remove_rvalue_reference + template + struct _Remove_rvalue_reference + { // remove rvalue reference + typedef _Ty _Type; + }; +! #if 0 /* Disabled for gccxml */ + template + struct _Remove_rvalue_reference<_Ty&&> + { // remove rvalue reference + typedef _Ty _Type; + }; +! #endif /* Disabled for gccxml */ + // TEMPLATE STRUCT _Copy_cv + template +Index: xtree +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xtree,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xtree 18 Nov 2010 15:58:45 -0000 1.1 +--- xtree 18 Nov 2010 18:35:33 -0000 1.2 +*************** public: +*** 581,587 **** + + return (_Wherenode); + } +! + template + _Nodeptr _Buynode(_Valty&& _Val) + { // allocate a node with defaults +--- 581,587 ---- + + return (_Wherenode); + } +! #if 0 /* Disabled for gccxml */ + template + _Nodeptr _Buynode(_Valty&& _Val) + { // allocate a node with defaults +*************** public: +*** 597,603 **** + + return (_Wherenode); + } +! + enum _Redbl + { // colors for link to parent + _Red, _Black}; +--- 597,603 ---- + + return (_Wherenode); + } +! #endif /* Disabled for gccxml */ + enum _Redbl + { // colors for link to parent + _Red, _Black}; +*************** public: +*** 720,726 **** + _RERAISE; + _CATCH_END + } +! + _Tree(_Myt&& _Right) + : _Mybase(_Right.key_comp(), _Right._Alval) + { // construct tree by copying _Right +--- 720,726 ---- + _RERAISE; + _CATCH_END + } +! #if 0 /* Disabled for gccxml */ + _Tree(_Myt&& _Right) + : _Mybase(_Right.key_comp(), _Right._Alval) + { // construct tree by copying _Right +*************** public: +*** 785,791 **** + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! + ~_Tree() + { // destroy tree + _Tidy(); +--- 785,791 ---- + { // exchange contents with movable _Right + _Assign_rv(_STD forward<_Myt>(_Right)); + } +! #endif /* Disabled for gccxml */ + ~_Tree() + { // destroy tree + _Tidy(); +Index: xutility +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xutility,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xutility 18 Nov 2010 15:58:45 -0000 1.1 +--- xutility 18 Nov 2010 18:35:33 -0000 1.2 +*************** template inline +--- 2503,2509 ---- + _Dest, _Is_checked(_Dest))); + } + #endif /* _ITERATOR_DEBUG_LEVEL == 0 */ +! #if 0 /* Disabled for gccxml */ + // TEMPLATE FUNCTION move + template inline +*************** template inline + _OutIt _Move(_InIt _First, _InIt _Last, +--- 2514,2520 ---- + *_Dest = _STD move(*_First); + return (_Dest); + } +! #endif /* Disabled for gccxml */ + template inline + _OutIt _Move(_InIt _First, _InIt _Last, +Index: xxresult +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/xxresult,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xxresult 18 Nov 2010 15:58:45 -0000 1.1 +--- xxresult 18 Nov 2010 19:06:39 -0000 1.2 +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template +*************** template::_Type _Type; + }; + ++ #if 0 /* Disabled for gccxml */ + #ifdef _M_IX86 + template +*************** template +*************** +*** 243,248 **** +--- 262,287 ---- + #endif + + ++ /* ------------------------------------------------------------------------ */ ++ /* Forward declare these now because they are used as non-dependent names. */ ++ #ifdef _DEBUG ++ ++ #if !defined(_NATIVE_WCHAR_T_DEFINED) && defined(_M_CEE_PURE) ++ extern "C++" ++ #else ++ extern "C" ++ #endif ++ _CRTIMP void __cdecl _invalid_parameter(_In_opt_z_ const wchar_t *, _In_opt_z_ const wchar_t *, _In_opt_z_ const wchar_t *, unsigned int, uintptr_t); ++ ++ #else /* _DEBUG */ ++ ++ extern "C" ++ _CRTIMP void __cdecl _invalid_parameter_noinfo(void); ++ ++ #endif /* def _DEBUG */ ++ /* ------------------------------------------------------------------------ */ ++ ++ + #if _SECURE_SCL_THROWS + + #ifndef _SILENCE_DEPRECATION_OF_SECURE_SCL_THROWS +*************** _STD_END +*** 540,547 **** + /* VC++ COMPILER PARAMETERS */ + #define _LONGLONG __int64 + #define _ULONGLONG unsigned __int64 +! #define _LLONG_MAX 0x7fffffffffffffff +! #define _ULLONG_MAX 0xffffffffffffffff + + /* INTEGER PROPERTIES */ + #define _C2 1 /* 0 if not 2's complement */ +--- 579,586 ---- + /* VC++ COMPILER PARAMETERS */ + #define _LONGLONG __int64 + #define _ULONGLONG unsigned __int64 +! #define _LLONG_MAX 0x7fffffffffffffffi64 +! #define _ULLONG_MAX 0xffffffffffffffffui64 + + /* INTEGER PROPERTIES */ + #define _C2 1 /* 0 if not 2's complement */ +*************** private: +*** 633,642 **** + static _MRTIMP2_NPURE void __cdecl _Lockit_ctor(_Lockit *); + static _MRTIMP2_NPURE void __cdecl _Lockit_ctor(_Lockit *, int); + static _MRTIMP2_NPURE void __cdecl _Lockit_dtor(_Lockit *); +! + __CLR_OR_THIS_CALL _Lockit(const _Lockit&); // not defined + _Lockit& __CLR_OR_THIS_CALL operator=(const _Lockit&); // not defined +! + int _Locktype; + + #else /* _MULTI_THREAD */ +--- 672,681 ---- + static _MRTIMP2_NPURE void __cdecl _Lockit_ctor(_Lockit *); + static _MRTIMP2_NPURE void __cdecl _Lockit_ctor(_Lockit *, int); + static _MRTIMP2_NPURE void __cdecl _Lockit_dtor(_Lockit *); +! #if 0 /* Disabled for gccxml */ + __CLR_OR_THIS_CALL _Lockit(const _Lockit&); // not defined + _Lockit& __CLR_OR_THIS_CALL operator=(const _Lockit&); // not defined +! #endif /* Disabled for gccxml */ + int _Locktype; + + #else /* _MULTI_THREAD */ +Index: CodeAnalysis/sourceannotations.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/Include/CodeAnalysis/sourceannotations.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** CodeAnalysis/sourceannotations.h 18 Nov 2010 15:58:45 -0000 1.1 +--- CodeAnalysis/sourceannotations.h 18 Nov 2010 18:38:36 -0000 1.2 +*************** typedef unsigned short wchar_t; +*** 42,48 **** + + #ifdef __cplusplus + #define SA( id ) id +! #define REPEATABLE [repeatable] + #else // !__cplusplus + #define SA( id ) SA_##id + #define REPEATABLE +--- 42,48 ---- + + #ifdef __cplusplus + #define SA( id ) id +! #define REPEATABLE + #else // !__cplusplus + #define SA( id ) SA_##id + #define REPEATABLE +*************** typedef enum SA( AccessType ) SA( Access +*** 76,82 **** + #ifndef SAL_NO_ATTRIBUTE_DECLARATIONS + + REPEATABLE +- [source_annotation_attribute( SA( Parameter ) )] + struct PreAttribute + { + #ifdef __cplusplus +--- 76,81 ---- +*************** struct PreAttribute +*** 107,113 **** + }; + + REPEATABLE +- [source_annotation_attribute( SA( Parameter )|SA( ReturnValue ) )] + struct PostAttribute + { + #ifdef __cplusplus +--- 106,111 ---- +*************** struct PostAttribute +*** 138,144 **** + const wchar_t* Condition; + }; + +- [source_annotation_attribute( SA( Parameter ) )] + struct FormatStringAttribute + { + #ifdef __cplusplus +--- 136,141 ---- +*************** struct FormatStringAttribute +*** 150,156 **** + }; + + REPEATABLE +- [source_annotation_attribute( SA( ReturnValue ) )] + struct InvalidCheckAttribute + { + #ifdef __cplusplus +--- 147,152 ---- +*************** struct InvalidCheckAttribute +*** 160,166 **** + long Value; + }; + +- [source_annotation_attribute( SA( Method ) )] + struct SuccessAttribute + { + #ifdef __cplusplus +--- 156,161 ---- +*************** struct SuccessAttribute +*** 171,177 **** + }; + + REPEATABLE +- [source_annotation_attribute( SA( Parameter ) )] + struct PreBoundAttribute + { + #ifdef __cplusplus +--- 166,171 ---- +*************** struct PreBoundAttribute +*** 181,187 **** + }; + + REPEATABLE +- [source_annotation_attribute( SA( Parameter )|SA( ReturnValue ) )] + struct PostBoundAttribute + { + #ifdef __cplusplus +--- 175,180 ---- +*************** struct PostBoundAttribute +*** 191,197 **** + }; + + REPEATABLE +- [source_annotation_attribute( SA( Parameter ) )] + struct PreRangeAttribute + { + #ifdef __cplusplus +--- 184,189 ---- +*************** struct PreRangeAttribute +*** 203,209 **** + }; + + REPEATABLE +- [source_annotation_attribute( SA( Parameter )|SA( ReturnValue ) )] + struct PostRangeAttribute + { + #ifdef __cplusplus +--- 195,200 ---- diff --git a/GCC_XML/VcInstall/vc10PlatformSDK.patch b/GCC_XML/VcInstall/vc10PlatformSDK.patch new file mode 100644 index 0000000..88b86da --- /dev/null +++ b/GCC_XML/VcInstall/vc10PlatformSDK.patch @@ -0,0 +1,465 @@ +Index: OAIdl.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/PlatformSDK/OAIdl.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** OAIdl.h 18 Nov 2010 15:58:49 -0000 1.1 +--- OAIdl.h 18 Nov 2010 18:51:09 -0000 1.2 +*************** struct tagVARIANT +*** 442,448 **** + FLOAT fltVal; + DOUBLE dblVal; + VARIANT_BOOL boolVal; +! _VARIANT_BOOL bool; + SCODE scode; + CY cyVal; + DATE date; +--- 442,448 ---- + FLOAT fltVal; + DOUBLE dblVal; + VARIANT_BOOL boolVal; +! // _VARIANT_BOOL bool; + SCODE scode; + CY cyVal; + DATE date; +*************** struct tagVARIANT +*** 457,463 **** + FLOAT *pfltVal; + DOUBLE *pdblVal; + VARIANT_BOOL *pboolVal; +! _VARIANT_BOOL *pbool; + SCODE *pscode; + CY *pcyVal; + DATE *pdate; +--- 457,463 ---- + FLOAT *pfltVal; + DOUBLE *pdblVal; + VARIANT_BOOL *pboolVal; +! // _VARIANT_BOOL *pbool; + SCODE *pscode; + CY *pcyVal; + DATE *pdate; +Index: ObjBase.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/PlatformSDK/ObjBase.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** ObjBase.h 18 Nov 2010 15:58:49 -0000 1.1 +--- ObjBase.h 18 Nov 2010 18:52:02 -0000 1.2 +*************** extern "C++" +*** 236,242 **** + { + template void** IID_PPV_ARGS_Helper(T** pp) + { +! static_cast(*pp); // make sure everyone derives from IUnknown + return reinterpret_cast(pp); + } + } +--- 236,242 ---- + { + template void** IID_PPV_ARGS_Helper(T** pp) + { +! //static_cast(*pp); // make sure everyone derives from IUnknown + return reinterpret_cast(pp); + } + } +Index: PropIdl.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/PlatformSDK/PropIdl.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** PropIdl.h 18 Nov 2010 15:58:50 -0000 1.1 +--- PropIdl.h 18 Nov 2010 18:52:32 -0000 1.2 +*************** struct tag_inner_PROPVARIANT +*** 316,322 **** + FLOAT fltVal; + DOUBLE dblVal; + VARIANT_BOOL boolVal; +! _VARIANT_BOOL bool; + SCODE scode; + CY cyVal; + DATE date; +--- 316,322 ---- + FLOAT fltVal; + DOUBLE dblVal; + VARIANT_BOOL boolVal; +! // _VARIANT_BOOL bool; + SCODE scode; + CY cyVal; + DATE date; +Index: WinNT.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/PlatformSDK/WinNT.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** WinNT.h 18 Nov 2010 15:58:52 -0000 1.1 +--- WinNT.h 18 Nov 2010 18:53:29 -0000 1.2 +*************** Int64ShllMod32 ( +*** 799,811 **** + __in DWORD ShiftCount + ) + { +- __asm { +- mov ecx, ShiftCount +- mov eax, dword ptr [Value] +- mov edx, dword ptr [Value+4] +- shld edx, eax, cl +- shl eax, cl +- } + } + + __inline LONGLONG +--- 799,804 ---- +*************** Int64ShraMod32 ( +*** 815,827 **** + __in DWORD ShiftCount + ) + { +- __asm { +- mov ecx, ShiftCount +- mov eax, dword ptr [Value] +- mov edx, dword ptr [Value+4] +- shrd eax, edx, cl +- sar edx, cl +- } + } + + __inline ULONGLONG +--- 808,813 ---- +*************** Int64ShrlMod32 ( +*** 831,843 **** + __in DWORD ShiftCount + ) + { +- __asm { +- mov ecx, ShiftCount +- mov eax, dword ptr [Value] +- mov edx, dword ptr [Value+4] +- shrd eax, edx, cl +- shr edx, cl +- } + } + + #if _MSC_VER >= 1200 +--- 817,822 ---- +*************** typedef struct _CONTEXT_EX { +*** 2232,2238 **** + // + + C_ASSERT((sizeof(XSAVE_FORMAT) & (XSAVE_ALIGN - 1)) == 0); +! C_ASSERT((FIELD_OFFSET(XSAVE_AREA, Header) & (XSAVE_ALIGN - 1)) == 0); + + // XSAVE_AREA structure must be sized uniformly on all architectures + C_ASSERT(MINIMAL_XSTATE_AREA_LENGTH == 512 + 64); +--- 2211,2217 ---- + // + + C_ASSERT((sizeof(XSAVE_FORMAT) & (XSAVE_ALIGN - 1)) == 0); +! //C_ASSERT((FIELD_OFFSET(XSAVE_AREA, Header) & (XSAVE_ALIGN - 1)) == 0); + + // XSAVE_AREA structure must be sized uniformly on all architectures + C_ASSERT(MINIMAL_XSTATE_AREA_LENGTH == 512 + 64); +*************** InterlockedBitTestAndSet ( +*** 3722,3733 **** + __in LONG Bit + ) + { +- __asm { +- mov eax, Bit +- mov ecx, Base +- lock bts [ecx], eax +- setc al +- }; + } + + FORCEINLINE +--- 3701,3706 ---- +*************** InterlockedBitTestAndReset ( +*** 3737,3748 **** + __in LONG Bit + ) + { +- __asm { +- mov eax, Bit +- mov ecx, Base +- lock btr [ecx], eax +- setc al +- }; + } + #pragma warning(pop) + +--- 3710,3715 ---- +*************** InterlockedBitTestAndComplement ( +*** 3793,3804 **** + __in LONG Bit + ) + { +- __asm { +- mov eax, Bit +- mov ecx, Base +- lock btc [ecx], eax +- setc al +- }; + } + #pragma warning(pop) + #endif /* _M_CEE_PURE */ +--- 3760,3765 ---- +*************** _mm_pause ( +*** 3917,3923 **** + #else + + #if !defined(_M_CEE_PURE) +! #define YieldProcessor() __asm { rep nop } + #endif // !defined(_M_CEE_PURE) + + #endif // (_MSC_FULL_VER >= 140041204) +--- 3878,3884 ---- + #else + + #if !defined(_M_CEE_PURE) +! #define YieldProcessor() + #endif // !defined(_M_CEE_PURE) + + #endif // (_MSC_FULL_VER >= 140041204) +*************** MemoryBarrier ( +*** 3940,3949 **** + VOID + ) + { +- LONG Barrier; +- __asm { +- xchg Barrier, eax +- } + } + #pragma warning( pop ) + +--- 3901,3906 ---- +*************** ReadPMC ( +*** 3987,3996 **** + ) + + { +- __asm { +- mov ecx, Counter +- rdpmc +- }; + } + + #endif +--- 3944,3949 ---- +*************** ReadTimeStampCounter ( +*** 4019,4025 **** + ) + + { +- __asm rdtsc + } + + #endif +--- 3972,3977 ---- +*************** DbgRaiseAssertionFailure ( +*** 4061,4067 **** + ) + + { +- __asm int 0x2c + } + + #pragma warning( pop ) +--- 4013,4018 ---- +*************** __inline PVOID GetCurrentFiber( void ) { +*** 4082,4093 **** + #pragma warning(push) + #endif + #pragma warning (disable:4035 4793) // disable 4035 (function must return something) +! __inline PVOID GetFiberData( void ) { __asm { +! mov eax, fs:[0x10] +! mov eax,[eax] +! } + } +! __inline PVOID GetCurrentFiber( void ) { __asm mov eax, fs:[0x10] } + + #if _MSC_VER >= 1200 + #pragma warning(pop) +--- 4033,4041 ---- + #pragma warning(push) + #endif + #pragma warning (disable:4035 4793) // disable 4035 (function must return something) +! __inline PVOID GetFiberData( void ) { + } +! __inline PVOID GetCurrentFiber( void ) { } + + #if _MSC_VER >= 1200 + #pragma warning(pop) +*************** HEAP_MAKE_TAG_FLAGS ( +*** 12958,12964 **** + ) + + { +- __assume_bound(TagBase); + return ((DWORD)((TagBase) + ((Tag) << HEAP_TAG_SHIFT))); + } + #endif +--- 12906,12911 ---- +*************** typedef enum _ENLISTMENT_INFORMATION_CLA +*** 14616,14622 **** + } ENLISTMENT_INFORMATION_CLASS; + + typedef struct _TRANSACTION_LIST_ENTRY { +! UOW UOW; + } TRANSACTION_LIST_ENTRY, *PTRANSACTION_LIST_ENTRY; + + typedef struct _TRANSACTION_LIST_INFORMATION { +--- 14563,14569 ---- + } ENLISTMENT_INFORMATION_CLASS; + + typedef struct _TRANSACTION_LIST_ENTRY { +! ::UOW UOW; + } TRANSACTION_LIST_ENTRY, *PTRANSACTION_LIST_ENTRY; + + typedef struct _TRANSACTION_LIST_INFORMATION { +*************** __inline struct _TEB * NtCurrentTeb( voi +*** 14989,14995 **** + + #pragma warning (disable:4035) // disable 4035 (function must return something) + +! __inline struct _TEB * NtCurrentTeb( void ) { __asm mov eax, fs:[PcTeb] } + + #if _MSC_VER >= 1200 + #pragma warning(pop) +--- 14936,14942 ---- + + #pragma warning (disable:4035) // disable 4035 (function must return something) + +! __inline struct _TEB * NtCurrentTeb( void ) { } + + #if _MSC_VER >= 1200 + #pragma warning(pop) +Index: driverspecs.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/PlatformSDK/driverspecs.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** driverspecs.h 18 Nov 2010 15:58:53 -0000 1.1 +--- driverspecs.h 18 Nov 2010 18:57:48 -0000 1.2 +*************** extern "C" { +*** 278,285 **** + #define __drv_in_deref(annotes) __pre __deref __$drv_group(##__drv_nop(annotes)) + #define __drv_out(annotes) __post __$drv_group(##__drv_nop(annotes)) + #define __drv_out_deref(annotes) __post __deref __$drv_group(##__drv_nop(annotes)) +! #define __drv_when(cond, annotes) \ +! __drv_declspec("SAL_when(" SPECSTRINGIZE(cond) ")") __$drv_group(##__drv_nop(annotes)) + #define __drv_at(expr,annotes)\ + __drv_declspec("SAL_at(" SPECSTRINGIZE(expr) ")") __$drv_group(##__drv_nop(annotes)) + +--- 278,285 ---- + #define __drv_in_deref(annotes) __pre __deref __$drv_group(##__drv_nop(annotes)) + #define __drv_out(annotes) __post __$drv_group(##__drv_nop(annotes)) + #define __drv_out_deref(annotes) __post __deref __$drv_group(##__drv_nop(annotes)) +! #define __drv_when(cond, annotes) +! //__drv_declspec("SAL_when(" SPECSTRINGIZE(cond) ")") __$drv_group(##__drv_nop(annotes)) + #define __drv_at(expr,annotes)\ + __drv_declspec("SAL_at(" SPECSTRINGIZE(expr) ")") __$drv_group(##__drv_nop(annotes)) + +*************** extern "C" { +*** 354,361 **** + // This can be tested by the condition function inFunctionClass$() + // + __ANNOTATION(SAL_functionClass(__in char *);) +! #define __drv_functionClass(x) \ +! __drv_out(__drv_declspec("SAL_functionClass(\""#x"\")")) + + // --------------------------------------------------------------------- + // Resources: +--- 354,361 ---- + // This can be tested by the condition function inFunctionClass$() + // + __ANNOTATION(SAL_functionClass(__in char *);) +! #define __drv_functionClass(x) +! //__drv_out(__drv_declspec("SAL_functionClass(\""#x"\")")) + + // --------------------------------------------------------------------- + // Resources: +*************** extern "C" { +*** 650,656 **** + // + __ANNOTATION(SAL_error(__in __AuToQuOtE char *);) + #define __drv_reportError(why) \ +! __pre __drv_declspec("SAL_error(" SPECSTRINGIZE(why) ")") + + // --------------------------------------------------------------------- + // Floating point save/restore: +--- 650,656 ---- + // + __ANNOTATION(SAL_error(__in __AuToQuOtE char *);) + #define __drv_reportError(why) \ +! //__pre __drv_declspec("SAL_error(" SPECSTRINGIZE(why) ")") + + // --------------------------------------------------------------------- + // Floating point save/restore: +Index: ktmtypes.h +=================================================================== +RCS file: /cvsroot/GxInclude/Vc10/PlatformSDK/ktmtypes.h,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** ktmtypes.h 18 Nov 2010 15:58:55 -0000 1.1 +--- ktmtypes.h 18 Nov 2010 18:51:27 -0000 1.2 +*************** extern "C" { +*** 24,30 **** + #endif + + +! typedef GUID UOW, *PUOW; + typedef GUID CRM_PROTOCOL_ID, *PCRM_PROTOCOL_ID; + + // +--- 24,32 ---- + #endif + + +! typedef GUID UOW; +! typedef UOW* PUOW; +! + typedef GUID CRM_PROTOCOL_ID, *PCRM_PROTOCOL_ID; + + // +*************** typedef struct _TRANSACTION_NOTIFICATION +*** 139,145 **** + + typedef struct _TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT { + GUID EnlistmentId; +! UOW UOW; + } TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT, *PTRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT; + + #define TRANSACTION_NOTIFICATION_TM_ONLINE_FLAG_IS_CLUSTERED 0x1 +--- 141,147 ---- + + typedef struct _TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT { + GUID EnlistmentId; +! ::UOW UOW; + } TRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT, *PTRANSACTION_NOTIFICATION_RECOVERY_ARGUMENT; + + #define TRANSACTION_NOTIFICATION_TM_ONLINE_FLAG_IS_CLUSTERED 0x1 +*************** typedef struct _KCRM_MARSHAL_HEADER { +*** 184,190 **** + } KCRM_MARSHAL_HEADER, *PKCRM_MARSHAL_HEADER, *RESTRICTED_POINTER PRKCRM_MARSHAL_HEADER; + + typedef struct _KCRM_TRANSACTION_BLOB { +! UOW UOW; + GUID TmIdentity; + ULONG IsolationLevel; + ULONG IsolationFlags; +--- 186,192 ---- + } KCRM_MARSHAL_HEADER, *PKCRM_MARSHAL_HEADER, *RESTRICTED_POINTER PRKCRM_MARSHAL_HEADER; + + typedef struct _KCRM_TRANSACTION_BLOB { +! ::UOW UOW; + GUID TmIdentity; + ULONG IsolationLevel; + ULONG IsolationFlags; diff --git a/GCC_XML/VcInstall/vcInstall.cxx b/GCC_XML/VcInstall/vcInstall.cxx index f8608d2..1c05138 100644 --- a/GCC_XML/VcInstall/vcInstall.cxx +++ b/GCC_XML/VcInstall/vcInstall.cxx @@ -58,6 +58,8 @@ int main(int argc, char* argv[]) gxSystemTools::RemoveADirectory((gccxmlRoot+"/Vc71").c_str()); gxSystemTools::RemoveADirectory((gccxmlRoot+"/Vc8").c_str()); gxSystemTools::RemoveADirectory((gccxmlRoot+"/Vc8ex").c_str()); + gxSystemTools::RemoveADirectory((gccxmlRoot+"/Vc9").c_str()); + gxSystemTools::RemoveADirectory((gccxmlRoot+"/Vc10").c_str()); // The registry keys for MSVC install detection. const char* vc6Registry = @@ -99,6 +101,12 @@ int main(int argc, char* argv[]) "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0\\Setup\\VC;ProductDir"; const char* vc9sdkRegistry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0A;InstallationFolder"; + + const char* vc10Registry = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir"; + const char* vc10sdkRegistry = + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.0A;InstallationFolder"; + // Check which versions of MSVC are installed. std::string msvc6; std::string msvc7; @@ -108,6 +116,10 @@ int main(int argc, char* argv[]) std::string msvc8sdk; std::string msvc9; std::string msvc9sdk; + + std::string msvc10; + std::string msvc10sdk; + bool have6 = gxSystemTools::ReadRegistryValue(vc6Registry, msvc6); bool have7 = gxSystemTools::ReadRegistryValue(vc7Registry, msvc7); bool have71 = gxSystemTools::ReadRegistryValue(vc71Registry, msvc71); @@ -117,6 +129,10 @@ int main(int argc, char* argv[]) gxSystemTools::ReadRegistryValue(vc9exRegistry, msvc9)); bool have9sdk = have9 && gxSystemTools::ReadRegistryValue(vc9sdkRegistry, msvc9sdk); + + bool have10 = gxSystemTools::ReadRegistryValue(vc10Registry, msvc10); + bool have10sdk = have10 && gxSystemTools::ReadRegistryValue(vc10sdkRegistry, msvc10sdk); + // Look for a VS8 express that is not the beta release. if(gxSystemTools::ReadRegistryValue(vc8exRegistry, msvc8ex)) { @@ -160,23 +176,23 @@ int main(int argc, char* argv[]) } // See if there is anything to do. - if(!have6 && !have7 && !have71 && !have8 && !have8ex && !have9) + if(!have6 && !have7 && !have71 && !have8 && !have8ex && !have9 && !have10) { - std::cout << "None of MSVC 6, 7, 7.1, 8, or 9 is installed.\n"; + std::cout << "None of MSVC 6, 7, 7.1, 8, 9 or 10 is installed.\n"; } // Need to install at least one of the support directories. We need // to find the cat and patch executables. std::string patchCommand; if(!FindTool(patchDir.c_str(), "patch", patchCommand) && - (have6||have7||have71||have8||have8ex||have9)) + (have6||have7||have71||have8||have8ex||have9||have10)) { std::cerr << "Cannot find patch executable.\n"; return 1; } std::string catCommand; if(!FindTool(patchDir.c_str(), "cat", catCommand) && - (have6||have7||have71||have8||have8ex||have9)) + (have6||have7||have71||have8||have8ex||have9||have10)) { std::cerr << "Cannot find cat executable.\n"; return 1; @@ -439,6 +455,54 @@ int main(int argc, char* argv[]) } } + + if(have10) + { + std::string msvc10i = msvc10 + "/Include"; + msvc10i = gxSystemTools::CollapseDirectory(msvc10i.c_str()); + std::string patchIname = "vc10Include.patch"; + std::string destPathI = gccxmlRoot+"/Vc10/Include"; + std::string msvc10sp1; + std::string patchI = patchDir + "/" + patchIname; + if(gxSystemTools::FileExists(patchI.c_str())) + { + if(!InstallSupport(patchCommand.c_str(), catCommand.c_str(), + patchI.c_str(), msvc10i.c_str(), destPathI.c_str())) + { + result = 1; + } + } + else + { + std::cerr << "Have MSVC 10, but cannot find " + << patchIname << ".\n"; + result = 1; + } + } + if(have10sdk) + { + std::string msvc10p = msvc10sdk + "/Include"; + msvc10p = gxSystemTools::CollapseDirectory(msvc10p.c_str()); + std::string patchPname = "vc10PlatformSDK.patch"; + std::string destPathP = gccxmlRoot+"/Vc10/PlatformSDK"; + + std::string patchP = patchDir + "/" + patchPname; + if(gxSystemTools::FileExists(patchP.c_str())) + { + if(!InstallSupport(patchCommand.c_str(), catCommand.c_str(), + patchP.c_str(), msvc10p.c_str(), destPathP.c_str())) + { + result = 1; + } + } + else + { + std::cerr << "Have MSVC 10 Platform SDK, but " + << "cannot find " << patchPname << ".\n"; + result = 1; + } + } + // If we succeeded, write the timestamp file. if(result == 0 && (timestamp.length() > 0)) { @@ -483,6 +547,12 @@ bool InstallSupport(const char* patchCommand, const char* catCommand, std::string dest = destPath; dest += "/"+line.substr(7); gxSystemTools::FileCopy(source.c_str(), dest.c_str()); + mode_t mode; + if(gxSystemTools::GetPermissions(dest.c_str(), mode)) + { + mode = mode | 0200; + gxSystemTools::SetPermissions(dest.c_str(), mode); + } } } std::string cmd = catCommand;