Commit 5d367c63 authored by Berenger Bramas's avatar Berenger Bramas

Inastemp - clean from previous work

parents
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: true
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
PenaltyBreakBeforeFirstCallParameter: 140
PenaltyBreakComment: 140
PenaltyBreakFirstLessLess: 140
PenaltyBreakString: 140
PenaltyExcessCharacter: 10000
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: true
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: Never
inastemp:
script:
- mkdir build
- cd build
- VERBOSE=1 cmake ..
- make
- make test
inastempsde:
script:
- mkdir build
- cd build
- VERBOSE=1 cmake -DINASTEMP_ISDE_CPU=ON -DINASTEMP_ISDE_UTESTS=ON -DINASTEMP_USE_AVX512KNL=ON ..
- make
- make test
inastempclang:
script:
- mkdir build
- cd build
- VERBOSE=1 CC=clang-3.5 CXX=clang++-3.5 cmake ..
- make
- make test
inastempclangsde:
script:
- mkdir build
- cd build
- VERBOSE=1 CC=clang-3.5 CXX=clang++-3.5 cmake -DINASTEMP_ISDE_CPU=ON -DINASTEMP_ISDE_UTESTS=ON -DINASTEMP_USE_AVX512KNL=ON ..
- make
- make test
inastempgcc49:
script:
- mkdir build
- cd build
- VERBOSE=1 CC=gcc-4.9 CXX=g++-4.9 cmake ..
- make
- make test
###########################################################################
# Inastemp - Berenger Bramas MPCDF - 2016
# Under MIT Licence, please you must read the LICENCE file.
###########################################################################
cmake_minimum_required (VERSION 2.8.3 FATAL_ERROR)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
#===========================================================================
# Project Declaration
#===========================================================================
project(INASTEMP C CXX)
# check if compiling into source directories
string(COMPARE EQUAL "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" insource)
if(insource)
message(FATAL_ERROR "${PROJECT_NAME} requires an out of source build. Goto ./Build and tapes cmake ../")
endif(insource)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/)
set(INASTEMP_CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
# Adds the CMAKE_DEPENDENT_OPTION command
INCLUDE(CMakeDependentOption)
# Release by default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE)
endif(NOT CMAKE_BUILD_TYPE)
if($ENV{VERBOSE})
MESSAGE(STATUS "Main -- CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}")
endif()
#===========================================================================
# Version Number
#===========================================================================
set(INASTEMP_MAJOR_VERSION 0)
set(INASTEMP_MINOR_VERSION 1)
set(INASTEMP_PATCH_VERSION 0)
set(INASTEMP_VERSION "${INASTEMP_MAJOR_VERSION}.${INASTEMP_MINOR_VERSION}.${INASTEMP_PATCH_VERSION}" )
#===========================================================================
# Options
#===========================================================================
# Ask CPU capacities
include(GetCpuInfos)
GetCpuInfos()
# Ask compiler capacities
include(GetCompilerInfos)
GetCompilerInfos()
# All types from worse to best (ADD-NEW-HERE)
set(ALL_TYPES "SSE3;SSSE3;SSE41;SSE42;AVX;AVX2;AVX512KNL")
set(ALL_USED_TYPES "SCALAR")
set(INASTEMP_USE_SCALAR ON)
set(INASTEMP_CXX_FLAGS "-std=c++11")
# Set custom cpu <=> vec rules (maybe ADD-NEW-HERE if needed)
set(AVX512KNL_CPU_RULES "AVX512ER;AVX512PF;AVX512ER")
foreach(TYPE ${ALL_TYPES})
if( COMPILER_INFO_${TYPE} )
if(NOT DEFINED ${TYPE}_CPU_RULES)
set( ${TYPE}_CPU_RULES "${TYPE}")
endif()
set(${TYPE}_SUPPORTED_BY_CPU TRUE)
foreach(RULE ${${TYPE}_CPU_RULES})
if(NOT DEFINED CPU_INFO_${RULE})
MESSAGE(WARNING "Main -- The variable CPU_INFO_${RULE} is not defined but used as rule for ${TYPE}")
endif()
if(NOT ${CPU_INFO_${RULE}})
set(${TYPE}_SUPPORTED_BY_CPU FALSE)
break()
endif()
endforeach()
OPTION( INASTEMP_USE_${TYPE} "Set to ON to compile with ${TYPE} support (default based on CPU capacities)" ${${TYPE}_SUPPORTED_BY_CPU} )
if(${INASTEMP_USE_${TYPE}})
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} ${${TYPE}_FLAGS}")
set(ALL_USED_TYPES "${ALL_USED_TYPES};${TYPE}")
if(COMPILER_INFO_${TYPE}_NOOP)
set(INASTEMP_USE_${TYPE}_OPERATORS ON)
else()
set(INASTEMP_USE_${TYPE}_OPERATORS OFF)
endif()
endif()
else()
if($ENV{VERBOSE})
MESSAGE(STATUS "Main -- The compiler cannot compile ${TYPE} intrinsics")
endif()
endif()
endforeach()
list(LENGTH ALL_USED_TYPES INASTEMP_NB_USED_TYPES)
if($ENV{VERBOSE})
MESSAGE(STATUS "Main -- INASTEMP_NB_USED_TYPES ${INASTEMP_NB_USED_TYPES}")
endif()
list(GET ALL_USED_TYPES -1 INASTEMP_BESTTYPE )
# Extra-flags
SET( INASTEMP_EXTRA_CXX_FLAGS "-funroll-loops" CACHE STRING "These flags are used for all configurations" )
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} ${INASTEMP_EXTRA_CXX_FLAGS}")
SET( INASTEMP_EXTRA_CXX_FLAGS_RELEASE "-O3" CACHE STRING "These flags are added to the usual ones for RELEASE" )
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${INASTEMP_EXTRA_CXX_FLAGS_RELEASE}")
SET( INASTEMP_EXTRA_CXX_FLAGS_DEBUG "-O0" CACHE STRING "These flags are added to the usual ones for DEBUG" )
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} ${INASTEMP_EXTRA_CXX_FLAGS_DEBUG}")
# Options
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} -std=c++11 -fpic -Wextra -Wnon-virtual-dtor -Wshadow -Wpointer-arith -Wcast-qual -Wconversion -Wall -Wno-sign-conversion -pedantic -Wold-style-cast -Woverloaded-virtual -Wpointer-arith -Wcast-qual -Wconversion -Wno-error")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} -m64")
endif()
OPTION( INASTEMP_ATTACHE_SOURCE "Set to on to add -g flag" OFF )
if( INASTEMP_ATTACHE_SOURCE )
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS} -g")
endif(INASTEMP_ATTACHE_SOURCE)
#===========================================================================
# Generate config
#===========================================================================
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Src/InastempConfig.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/Src/InastempConfig.h )
#===========================================================================
# Build lib
#===========================================================================
add_subdirectory(Src)
if(NOT INASTEMP_JUST_LIB)
#===========================================================================
# Build patterns
#===========================================================================
add_subdirectory(Patterns)
#===========================================================================
# Build unit tests
#===========================================================================
enable_testing()
add_subdirectory(UTests)
#===========================================================================
# Build examples
#===========================================================================
add_subdirectory(Examples)
else()
if($ENV{VERBOSE})
MESSAGE(STATUS "Main -- INASTEMP_JUST_LIB ${INASTEMP_JUST_LIB}")
endif()
endif()
#===========================================================================
# Export cmake info
#===========================================================================
configure_file(${INASTEMP_SOURCE_DIR}/CMakeModules/InastempInfo.cmake.in
${INASTEMP_BINARY_DIR}/InastempInfo.cmake
@ONLY IMMEDIATE
)
install(FILES ${INASTEMP_BINARY_DIR}/InastempInfo.cmake DESTINATION lib/ )
set(INASTEMP_CXX_FLAGS "${INASTEMP_CXX_FLAGS}" PARENT_SCOPE)
set(INASTEMP_BINARY_DIR "${INASTEMP_BINARY_DIR}" PARENT_SCOPE)
set(INASTEMP_SOURCE_DIR "${INASTEMP_SOURCE_DIR}" PARENT_SCOPE)
set(INASTEMP_INCLUDE_DIR "${INASTEMP_INCLUDE_DIR}" PARENT_SCOPE)
#include "immintrin.h"
int main() {
__m256d tx, ty ;
tx += ty ;
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> // SSSE3
#include <smmintrin.h> // SSE4
#include <immintrin.h> // AVX
int main(){
{
__m256d res0d, res1d;
res0d = _mm256_hadd_pd(res0d, res1d);
__m256 res0, res1;
res0 = _mm256_hadd_ps(res0, res1);
}
{
__m128d res0d, res1d;
res0d = _mm_hadd_pd(res0d, res1d);
__m128 res0, res1;
res0 = _mm_hadd_ps(res0, res1);
}
return 0;
}
#include "immintrin.h"
int main() {
#ifdef __MIC__
__m512 tx, ty ;
tx += ty ;
#endif
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> // SSSE3
#include <smmintrin.h> // SSE4
#include <immintrin.h> // AVX
int main(){
{
__m256d res0d, res1d;
res0d = _mm256_hadd_pd(res0d, res1d);
__m256 res0, res1;
res0 = _mm256_hadd_ps(res0, res1);
}
{
__m128d res0d, res1d;
res0d = _mm_hadd_pd(res0d, res1d);
__m128 res0, res1;
res0 = _mm_hadd_ps(res0, res1);
}
return 0;
}
#include "immintrin.h"
int main() {
__m512d tx, ty ;
tx += ty ;
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> // SSSE3
#include <smmintrin.h> // SSE4
#include <immintrin.h> // AVX
int main(){
__m512d res0d, res1d;
res0d = _mm512_add_pd(res0d, res1d);
__m512 res0, res1;
res0 = _mm512_add_ps(res0, res1);
return 0;
}
###########################################################################
# Inastemp - Berenger Bramas MPCDF - 2016
# Under MIT Licence, please you must read the LICENCE file.
###########################################################################
# Doc for intel :
# https://software.intel.com/en-us/articles/performance-tools-for-software-developers-intel-compiler-options-for-sse-generation-and-processor-specific-optimizations
#
# Doc for gcc :
# https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
###########################################################################
macro (GetCompilerInfosCore TYPE)
string(TOUPPER ${TYPE} UTYPE)
# The original CPP file
set(checkTypeFile "${PROJECT_SOURCE_DIR}/CMakeModules/${UTYPE}/compileTest${UTYPE}.cpp")
set(checkPeFile "${PROJECT_SOURCE_DIR}/CMakeModules/${UTYPE}/check${UTYPE}pe.cpp")
# Fatal error if the file does not exist
if(NOT EXISTS ${checkTypeFile})
message(FATAL_ERROR "The GetCompilerInfosFile does not exist (${checkTypeFile})")
endif()
if(NOT EXISTS ${checkPeFile})
message(FATAL_ERROR "The GetCompilerInfosFile does not exist (${checkPeFile})")
endif()
try_compile(COMPILE_RESULT ${CMAKE_CURRENT_BINARY_DIR}
${checkTypeFile}
COMPILE_DEFINITIONS "-Wno-error ${${UTYPE}_FLAGS}"
OUTPUT_VARIABLE COMPILE_OUTPUT)
if(${COMPILE_RESULT})
set(COMPILER_INFO_${UTYPE} ON)
if($ENV{VERBOSE})
message(STATUS "GetCompilerInfos -- The compiler can compile ${TYPE}")
endif()
try_compile(COMPILE_RESULT_PE ${CMAKE_CURRENT_BINARY_DIR}
${checkPeFile}
COMPILE_DEFINITIONS "-Wno-error ${${UTYPE}_FLAGS}"
OUTPUT_VARIABLE COMPILE_OUTPUT_PE)
if(${COMPILE_RESULT_PE})
set(COMPILER_INFO_${UTYPE}_NOOP OFF)
if($ENV{VERBOSE})
message(STATUS "GetCompilerInfos -- The compiler has operators for ${TYPE}")
endif()
else()
set(COMPILER_INFO_${UTYPE}_NOOP ON)
if($ENV{VERBOSE})
message(STATUS "GetCompilerInfos -- The compiler needs operators for ${TYPE} : ${COMPILE_OUTPUT_PE}")
endif()
endif()
else()
set(COMPILER_INFO_${UTYPE} OFF)
if($ENV{VERBOSE})
message(STATUS "GetCompilerInfos -- The compiler cannot compile ${TYPE} : ${COMPILE_OUTPUT}")
endif()
endif()
endmacro(GetCompilerInfosCore)
###########################################################################################
###########################################################################################
macro(GetCompilerInfos)
SET( ARCH_NATIVE_FLAG "-march=native" CACHE STRING "Additional flag for the compiler capacities detection" )
# (ADD-NEW-HERE for each compilers)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
if(APPLE) # INTEL APPLE
set(SSE3_FLAGS "-msse3 ${ARCH_NATIVE_FLAG}")
set(SSSE3_FLAGS "-mssse3 ${ARCH_NATIVE_FLAG}")
set(SSE41_FLAGS "-msse4 -msse4.1 ${ARCH_NATIVE_FLAG}")
set(SSE42_FLAGS "-msse4 -msse4.2 ${ARCH_NATIVE_FLAG}")
set(AVX_FLAGS "-mAVX ${ARCH_NATIVE_FLAG}")
set(AVX2_FLAGS "-march=core-avx2 ${ARCH_NATIVE_FLAG}")
set(AVX512KNL_FLAGS "-xCOMMON-AVX512 -xMIC-AVX512 ${ARCH_NATIVE_FLAG}")
else() # INTEL LINUX
set(SSE3_FLAGS "-msse3 ${ARCH_NATIVE_FLAG}")
set(SSSE3_FLAGS "-mssse3 ${ARCH_NATIVE_FLAG}")
set(SSE41_FLAGS "-msse4 -msse4.1 ${ARCH_NATIVE_FLAG}")
set(SSE42_FLAGS "-msse4 -msse4.2 ${ARCH_NATIVE_FLAG}")
set(AVX_FLAGS "-mAVX ${ARCH_NATIVE_FLAG}")
set(AVX2_FLAGS "-march=core-avx2 ${ARCH_NATIVE_FLAG}")
set(AVX512KNL_FLAGS "-xCOMMON-AVX512 -xMIC-AVX512 ${ARCH_NATIVE_FLAG}")
endif()
else()
if(APPLE) # GCC APPLE
set(SSE3_FLAGS "-msse3 ${ARCH_NATIVE_FLAG}")
set(SSSE3_FLAGS "-mssse3 ${ARCH_NATIVE_FLAG}")
set(SSE41_FLAGS "-msse4 -msse4.1 ${ARCH_NATIVE_FLAG}")
set(SSE42_FLAGS "-msse4 -msse4.2 ${ARCH_NATIVE_FLAG}")
set(AVX_FLAGS "-mavx ${ARCH_NATIVE_FLAG}")
set(AVX2_FLAGS "-mavx2 ${ARCH_NATIVE_FLAG}")
set(AVX512KNL_FLAGS "-mavx512f -mavx512pf -mavx512er -mavx512cd ${ARCH_NATIVE_FLAG}")
else() # GCC LINUX
set(SSE3_FLAGS "-msse3 ${ARCH_NATIVE_FLAG}")
set(SSSE3_FLAGS "-mssse3 ${ARCH_NATIVE_FLAG}")
set(SSE41_FLAGS "-msse4 -msse4.1 ${ARCH_NATIVE_FLAG}")
set(SSE42_FLAGS "-msse4 -msse4.2 ${ARCH_NATIVE_FLAG}")
set(AVX_FLAGS "-mavx ${ARCH_NATIVE_FLAG}")
set(AVX2_FLAGS "-mavx2 ${ARCH_NATIVE_FLAG}")
set(AVX512KNL_FLAGS "-mavx512f -mavx512pf -mavx512er -mavx512cd ${ARCH_NATIVE_FLAG}")
endif(APPLE)
endif()
# (ADD-NEW-HERE)
set(ALL_TYPES "SSE3;SSSE3;SSE41;SSE42;AVX;AVX2;AVX512KNL")
if($ENV{VERBOSE})
foreach(TYPE ${ALL_TYPES})
message(STATUS "GetCompilerInfos -- ${TYPE}_FLAGS = ${${TYPE}_FLAGS}")
endforeach()
endif()
foreach(TYPE ${ALL_TYPES})
GetCompilerInfosCore(${TYPE})
endforeach()
if($ENV{VERBOSE})
foreach(TYPE ${ALL_TYPES})
message(STATUS "GetCompilerInfos -- COMPILER_INFO_${TYPE} = ${COMPILER_INFO_${TYPE}}")
endforeach()
endif()
endmacro(GetCompilerInfos)
###########################################################################
# Inastemp - Berenger Bramas MPCDF - 2016
# Under MIT Licence, please you must read the LICENCE file.
###########################################################################
# This goes with the getCpuInfos.cpp
# This will create one CMAKE value per output option from the cpp file.
# For example the output of the CPP file can be:
# SSE3=TRUE;AVX=FALSE
# Then it will create:
# CPU_INFO_SSE3 = TRUE
# CPU_INFO_AVX = FALSE
#
# The binary should return 0 on success.
###########################################################################################
macro(GetCpuInfos)
# The original CPP file
set(GetCpuInfosFile "${PROJECT_SOURCE_DIR}/CMakeModules/getCpuInfos.cpp")
# Fatal error if the file does not exist
if(NOT EXISTS ${GetCpuInfosFile})
message(FATAL_ERROR "The GetCpuInfosFile does not exist (${GetCpuInfosFile})")
endif()
OPTION( INASTEMP_ISDE_CPU "Set to ON to run the CPU detection over sde64" OFF )
# Compile and execute the file
if(INASTEMP_ISDE_CPU)
if($ENV{VERBOSE})
message(STATUS "GetCpuInfosFile -- use intel SDE")
endif()
get_filename_component(
GetCpuInfosFileExec ${GetCpuInfosFile}
NAME_WE
)
set(GetCpuInfosFileExec "${CMAKE_CURRENT_BINARY_DIR}/${GetCpuInfosFileExec}")
try_compile(COMPILE_RESULT_VAR
${CMAKE_CURRENT_BINARY_DIR}/GetCpuInfos
${GetCpuInfosFile}
OUTPUT_VARIABLE comp
COPY_FILE ${GetCpuInfosFileExec})
if(COMPILE_RESULT_VAR)
if(NOT EXISTS ${GetCpuInfosFileExec})
message(FATAL_ERROR "The GetCpuInfosFile compiled file does not exist (${GetCpuInfosFileExec})")
endif()
exec_program("sde64 -- ${GetCpuInfosFileExec}" ${CMAKE_CURRENT_BINARY_DIR}
OUTPUT_VARIABLE run
RETURN_VALUE RUN_RESULT_VAR)
endif()
else()
# Simply try and run
try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
${CMAKE_CURRENT_BINARY_DIR} ${GetCpuInfosFile}
COMPILE_OUTPUT_VARIABLE comp
RUN_OUTPUT_VARIABLE run)
endif()
# If it has successfuly compiled an run
if(COMPILE_RESULT_VAR AND (RUN_RESULT_VAR EQUAL 0) )
set( CPU_OPTIONS ${run} )
# For each value
foreach(optionNode ${run})
# Get name and value
string(REPLACE "=" ";" optionNameAndValue ${optionNode})
list(LENGTH optionNameAndValue optionLength)
# If we get both
if(optionLength EQUAL 2)
list(GET optionNameAndValue 0 optionName)
list(GET optionNameAndValue 1 optionValue)
# create cmake variable
set(CPU_INFO_${optionName} ${optionValue})
else()
message(WARNING "GetCpuInfosFile wrong format for ${optionNode}.")
endif()
endforeach()
# output the sentence from the binrary
if($ENV{VERBOSE})
message(STATUS "GetCpuInfosFile -- results : ${CPU_OPTIONS}")
endif()
else()
message(WARNING "GetCpuInfosFile -- did not return correctly.")
message(WARNING "GetCpuInfosFile -- compilation output : ${comp}.")
message(WARNING "GetCpuInfosFile -- execution output : ${run}.")
endif()
endmacro(GetCpuInfos)
#include <xmmintrin.h> // SSE
#include <emmintrin.h> //SSE2
#include <pmmintrin.h> //SSE3
int main() {
__m128d tx, ty ;
tx += ty ;
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
int main(){
__m128d res0d, res1d;
res0d = _mm_hadd_pd(res0d, res1d);
__m128 res0, res1;
res0 = _mm_hadd_ps(res0, res1);
return 0;
}
#include <xmmintrin.h> // SSE
#include <emmintrin.h> //SSE2
#include <pmmintrin.h> //SSE3
#include <tmmintrin.h> //SSSE3
#include <smmintrin.h> //SSE41
int main() {
__m128d tx, ty ;
tx += ty ;
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> //SSSE3
#include <smmintrin.h> //SSE41
#ifndef __SSE4_1__
#error __SSE4_1__ must be defined
#endif
int main(){
__m128d res0d, res1d;
res0d = _mm_hadd_pd(res0d, res1d);
__m128 res0, res1;
res0 = _mm_hadd_ps(res0, res1);
return 0;
}
#include <xmmintrin.h> // SSE
#include <emmintrin.h> //SSE2
#include <pmmintrin.h> //SSE3
#include <tmmintrin.h> //SSSE3
#include <smmintrin.h> //SSE41
#include <nmmintrin.h> //SSE42
int main() {
__m128d tx, ty ;
tx += ty ;
return 0;
}
#include <x86intrin.h>
#include <xmmintrin.h> // SSE
#include <emmintrin.h> // SSE2
#include <pmmintrin.h> // SSE3
#include <tmmintrin.h> //SSSE3
#include <smmintrin.h> //SSE41