SMID 병렬프로그래밍
SIMD(Single Instruction Multiple Data) SIMD란 병렬 컴퓨팅의 한 종류로, 하나의 명령어로 여러 개의 값을 동시에 계산하는 방식이다. 변수형 typedef union __declspec (intrin_type) __declspec (align( 16 )) __m128i { __int8 m128i_i8[ 16 ]; __int16 m128i_i16[ 8 ]; __int32 m128i_i32[ 4 ]; __int64 m128i_i64[ 2 ]; unsigned __int8 m128i_u8[ 16 ]; unsigned __int16 m128i_u16[ 8 ]; unsigned __int32 m128i_u32[ 4 ]; unsigned __int64 m128i_u64[ 2 ]; } __m128i ; 사용법 __declspec(align __declspec (align( 32 )) struct s1 { int a, b, c, d; // sizeof(struct s1)는 32. 16바이트가 덧붙여진다. }; __declspec (align( 8 )) struct s2 { int a, b, c, d; // sizeof(struct s2)는 16. }; __mm_loadu_si128 __m128i a; // 128bit aligned 자료형 __declspec (align( 16 )) short v1[ 6 ] = { 1 , 2 , 3 , 4 , 5 , 6 }; //short 단위로 채움 a = _mm_loadu_si128(( __m128i *)v1); _mm_set1_epi32 __m128i b; // 128bit aligned 자료형 b = _mm_set1_epi32(( int ) 5 ); //in...