inline void rotate_left_wm1(F64vec4 *v0, const F64vec4 v1) { // {1.0, 2.0, 3.0, 4.0}; // {5.0, 6.0, 7.0, 8.0}; const __m128d hiv0 = _mm256_extractf128_pd(*v0, 1); // {3.0, 4.0} const __m128d phiv0 = _mm_permute_pd(hiv0, 0x1); // {4.0, 3.0} const __m256d shufv1 = _mm256_permute_pd(v1, 0x1); // {6.0, 5.0, 8.0, 7.0}; const __m128d shufv1_lo = _mm256_extractf128_pd(shufv1, 0); // {6.0, 5.0} const __m128d shufv1_hi = _mm256_extractf128_pd(shufv1, 1); // {8.0, 7.0} const __m128d v1_blend = _mm_blend_pd(shufv1_lo, shufv1_hi, 0x2); // blend {6.0, 7.0}; const __m256d inserted = _mm256_insertf128_pd(shufv1, v1_blend, 1); // insert {6.0, 5.0, 6.0, 7.0}; const __m256d blended = _mm256_blend_pd(_mm256_castpd128_pd256(phiv0), inserted, 0xE); *v0 = blended; }
void test2bit (void) { d1 = _mm_blend_pd (d2, d3, k4); /* { dg-error "the last argument must be a 2-bit immediate" } */ }
__m128d test_blend_pd(__m128d V1, __m128d V2) { // CHECK-LABEL: test_blend_pd // CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 0, i32 3> // CHECK-ASM: blendpd $2, %xmm{{.*}}, %xmm{{.*}} return _mm_blend_pd(V1, V2, 2); }
__m128d test_blend_pd(__m128d V1, __m128d V2) { // CHECK-LABEL: @test_blend_pd // CHECK: shufflevector <2 x double> %{{.*}}, <2 x double> %{{.*}}, <2 x i32> <i32 2, i32 1> return _mm_blend_pd(V1, V2, 1); }