--- boost_1_55_0.orig/libs/log/src/dump_avx2.cpp 2013-10-18 21:32:46.000000000 +0400 +++ boost_1_55_0/libs/log/src/dump_avx2.cpp 2014-04-26 21:16:35.434925557 +0400 @@ -22,6 +22,12 @@ #include #include +#if ((BOOST_GCC + 0) / 100) >= 407 +#define BOOST_LOG_AUX_TARGET_ATTRIB __attribute__((target("avx2,arch=core-avx2"))) +#else +#define BOOST_LOG_AUX_TARGET_ATTRIB +#endif + namespace boost { BOOST_LOG_OPEN_NAMESPACE @@ -59,7 +65,7 @@ * * The composed string is placed as follows (in Intel notation): mm_output1[127:0], mm_output2[127:0], mm_output3[127:0], mm_output1[255:128], mm_output2[255:128], mm_output3[255:128]. */ -static BOOST_FORCEINLINE void dump_pack(__m256i mm_char_10_to_a, __m256i mm_input, __m256i& mm_output1, __m256i& mm_output2, __m256i& mm_output3) +static BOOST_FORCEINLINE BOOST_LOG_AUX_TARGET_ATTRIB void dump_pack(__m256i mm_char_10_to_a, __m256i mm_input, __m256i& mm_output1, __m256i& mm_output2, __m256i& mm_output3) { // Split half-bytes const __m256i mm_15 = _mm256_set1_epi8(0x0F); @@ -100,7 +106,7 @@ } //! Dumps a pack of input data into a string of 8 bit ASCII characters -static BOOST_FORCEINLINE void dump_pack(__m256i mm_char_10_to_a, __m128i mm_input, __m128i& mm_output1, __m128i& mm_output2, __m128i& mm_output3) +static BOOST_FORCEINLINE BOOST_LOG_AUX_TARGET_ATTRIB void dump_pack(__m256i mm_char_10_to_a, __m128i mm_input, __m128i& mm_output1, __m128i& mm_output2, __m128i& mm_output3) { // Split half-bytes __m128i mm_input_hi = _mm_srli_epi16(mm_input, 4); @@ -127,7 +133,7 @@ } template< typename CharT > -BOOST_FORCEINLINE void store_characters(__m128i mm_chars, CharT* buf) +BOOST_FORCEINLINE BOOST_LOG_AUX_TARGET_ATTRIB void store_characters(__m128i mm_chars, CharT* buf) { switch (sizeof(CharT)) { @@ -150,7 +156,7 @@ } template< typename CharT > -BOOST_FORCEINLINE void store_characters_x3(__m256i mm_chars1, __m256i mm_chars2, __m256i mm_chars3, CharT* buf) +BOOST_FORCEINLINE BOOST_LOG_AUX_TARGET_ATTRIB void store_characters_x3(__m256i mm_chars1, __m256i mm_chars2, __m256i mm_chars3, CharT* buf) { store_characters(_mm256_castsi256_si128(mm_chars1), buf); store_characters(_mm256_castsi256_si128(mm_chars2), buf + 16); @@ -161,7 +167,7 @@ } template< typename CharT > -BOOST_FORCEINLINE void dump_data_avx2(const void* data, std::size_t size, std::basic_ostream< CharT >& strm) +BOOST_FORCEINLINE BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_avx2(const void* data, std::size_t size, std::basic_ostream< CharT >& strm) { typedef CharT char_type; @@ -205,7 +211,7 @@ __m256i mm_input = _mm256_load_si256(reinterpret_cast< const __m256i* >(p)); __m256i mm_output1, mm_output2, mm_output3; dump_pack(mm_char_10_to_a, mm_input, mm_output1, mm_output2, mm_output3); - store_characters_x3(mm_output1, mm_output2, mm_output3, buf); + store_characters_x3(mm_output1, mm_output2, mm_output3, b); } _mm256_zeroall(); // need to zero all ymm registers to avoid register spills/restores the compler generates around the function call @@ -245,7 +251,7 @@ } // namespace -void dump_data_char_avx2(const void* data, std::size_t size, std::basic_ostream< char >& strm) +BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_char_avx2(const void* data, std::size_t size, std::basic_ostream< char >& strm) { if (size >= 32) { @@ -257,7 +263,7 @@ } } -void dump_data_wchar_avx2(const void* data, std::size_t size, std::basic_ostream< wchar_t >& strm) +BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_wchar_avx2(const void* data, std::size_t size, std::basic_ostream< wchar_t >& strm) { if (size >= 32) { @@ -270,7 +276,7 @@ } #if !defined(BOOST_NO_CXX11_CHAR16_T) -void dump_data_char16_avx2(const void* data, std::size_t size, std::basic_ostream< char16_t >& strm) +BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_char16_avx2(const void* data, std::size_t size, std::basic_ostream< char16_t >& strm) { if (size >= 32) { @@ -284,7 +290,7 @@ #endif #if !defined(BOOST_NO_CXX11_CHAR32_T) -void dump_data_char32_avx2(const void* data, std::size_t size, std::basic_ostream< char32_t >& strm) +BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_char32_avx2(const void* data, std::size_t size, std::basic_ostream< char32_t >& strm) { if (size >= 32) { --- boost_1_55_0.orig/libs/log/src/dump_ssse3.cpp 2013-10-18 21:32:46.000000000 +0400 +++ boost_1_55_0/libs/log/src/dump_ssse3.cpp 2014-04-26 21:16:29.450925453 +0400 @@ -22,6 +22,12 @@ #include #include +#if ((BOOST_GCC + 0) / 100) >= 405 +#define BOOST_LOG_AUX_TARGET_ATTRIB __attribute__((target("ssse3,arch=core2"))) +#else +#define BOOST_LOG_AUX_TARGET_ATTRIB +#endif + namespace boost { BOOST_LOG_OPEN_NAMESPACE @@ -57,7 +63,7 @@ static const xmm_constant mm_shuffle_pattern3 = {{ 5, 0x80, 6, 7, 0x80, 8, 9, 0x80, 10, 11, 0x80, 12, 13, 0x80, 14, 15 }}; //! Dumps a pack of input data into a string of 8 bit ASCII characters -static BOOST_FORCEINLINE void dump_pack(__m128i mm_char_10_to_a, __m128i mm_input, __m128i& mm_output1, __m128i& mm_output2, __m128i& mm_output3) +static BOOST_FORCEINLINE BOOST_LOG_AUX_TARGET_ATTRIB void dump_pack(__m128i mm_char_10_to_a, __m128i mm_input, __m128i& mm_output1, __m128i& mm_output2, __m128i& mm_output3) { // Split half-bytes __m128i mm_input_hi = _mm_and_si128(_mm_srli_epi16(mm_input, 4), mm_15.as_mm); @@ -95,7 +101,7 @@ } template< typename CharT > -BOOST_FORCEINLINE void store_characters(__m128i mm_chars, CharT* buf) +BOOST_FORCEINLINE BOOST_LOG_AUX_TARGET_ATTRIB void store_characters(__m128i mm_chars, CharT* buf) { switch (sizeof(CharT)) { @@ -126,7 +132,7 @@ } template< typename CharT > -BOOST_FORCEINLINE void dump_data_ssse3(const void* data, std::size_t size, std::basic_ostream< CharT >& strm) +BOOST_FORCEINLINE BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_ssse3(const void* data, std::size_t size, std::basic_ostream< CharT >& strm) { typedef CharT char_type; @@ -210,7 +216,7 @@ } // namespace -void dump_data_char_ssse3(const void* data, std::size_t size, std::basic_ostream< char >& strm) +BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_char_ssse3(const void* data, std::size_t size, std::basic_ostream< char >& strm) { if (size >= 16) { @@ -222,7 +228,7 @@ } } -void dump_data_wchar_ssse3(const void* data, std::size_t size, std::basic_ostream< wchar_t >& strm) +BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_wchar_ssse3(const void* data, std::size_t size, std::basic_ostream< wchar_t >& strm) { if (size >= 16) { @@ -235,7 +241,7 @@ } #if !defined(BOOST_NO_CXX11_CHAR16_T) -void dump_data_char16_ssse3(const void* data, std::size_t size, std::basic_ostream< char16_t >& strm) +BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_char16_ssse3(const void* data, std::size_t size, std::basic_ostream< char16_t >& strm) { if (size >= 16) { @@ -249,7 +255,7 @@ #endif #if !defined(BOOST_NO_CXX11_CHAR32_T) -void dump_data_char32_ssse3(const void* data, std::size_t size, std::basic_ostream< char32_t >& strm) +BOOST_LOG_AUX_TARGET_ATTRIB void dump_data_char32_ssse3(const void* data, std::size_t size, std::basic_ostream< char32_t >& strm) { if (size >= 16) {