void static avx2_test (void) { int i; union128i_d idx; union128d res; double s1[2], res_ref[2] = { 0 }; for (i = 0; i < 2; ++i) { /* Set some stuff */ s1[i] = 2.718281828459045 * (i + 1) * (i + 2); /* About to gather in reverse order, divide by 2 to demonstrate scale */ idx.a[i] = (16 - (i + 1) * 8) >> 1; } res.x = _mm_i32gather_pd (s1, idx.x, 2); compute_i32gatherpd (s1, idx.a, 2, res_ref); if (check_union128d (res, res_ref) != 0) abort (); }
__m128d test_mm_i32gather_pd(double const *b, __m128i c) { // CHECK-LABEL: test_mm_i32gather_pd // CHECK: [[CMP:%.*]] = fcmp oeq <2 x double> // CHECK-NEXT: [[SEXT:%.*]] = sext <2 x i1> [[CMP]] to <2 x i64> // CHECK-NEXT: [[BC:%.*]] = bitcast <2 x i64> [[SEXT]] to <2 x double> // CHECK: call <2 x double> @llvm.x86.avx2.gather.d.pd(<2 x double> undef, i8* %{{.*}}, <4 x i32> %{{.*}}, <2 x double> %{{.*}}, i8 2) return _mm_i32gather_pd(b, c, 2); }
__m128d test_mm_i32gather_pd(double const *b, __m128i c) { // CHECK: @llvm.x86.avx2.gather.d.pd return _mm_i32gather_pd(b, c, 2); }
void extern avx2_test (void) { x = _mm_i32gather_pd (base, idx, 1); }