2 // Copyright Oliver Kowalke 2009.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
11 #include <emmintrin.h>
13 #include <boost/context/execution_context.hpp>
15 namespace ctx = boost::context;
17 void echoSSE( int i) {
19 xmm = _mm_set_epi32( i, i + 1, i + 2, i + 3);
21 memcpy( & v32, & xmm, 16);
28 ctx::execution_context< int > echo( ctx::execution_context< int > && ctx, int i) {
33 std::tie( ctx, i) = ctx( 0);
35 return std::move( ctx);
38 int main( int argc, char * argv[]) {
39 ctx::execution_context< int > ctx( echo);
40 for ( int i = 0; i < 10; ++i) {
41 ctx = std::get< 0 >( ctx( i) );
43 std::cout << "\nDone" << std::endl;