Index: cfe/trunk/lib/Headers/avx512fintrin.h =================================================================== --- cfe/trunk/lib/Headers/avx512fintrin.h +++ cfe/trunk/lib/Headers/avx512fintrin.h @@ -343,6 +343,49 @@ __f, __f, __f, __f }; } +static __inline __m512i __DEFAULT_FN_ATTRS +_mm512_set4_epi32 (int __A, int __B, int __C, int __D) +{ + return (__m512i)(__v16si) + { __D, __C, __B, __A, __D, __C, __B, __A, + __D, __C, __B, __A, __D, __C, __B, __A }; +} + +static __inline __m512i __DEFAULT_FN_ATTRS +_mm512_set4_epi64 (long long __A, long long __B, long long __C, + long long __D) +{ + return (__m512i) (__v8di) + { __D, __C, __B, __A, __D, __C, __B, __A }; +} + +static __inline __m512d __DEFAULT_FN_ATTRS +_mm512_set4_pd (double __A, double __B, double __C, double __D) +{ + return (__m512d) + { __D, __C, __B, __A, __D, __C, __B, __A }; +} + +static __inline __m512 __DEFAULT_FN_ATTRS +_mm512_set4_ps (float __A, float __B, float __C, float __D) +{ + return (__m512) + { __D, __C, __B, __A, __D, __C, __B, __A, + __D, __C, __B, __A, __D, __C, __B, __A }; +} + +#define _mm512_setr4_epi32(e0,e1,e2,e3) \ + _mm512_set4_epi32(e3,e2,e1,e0) + +#define _mm512_setr4_epi64(e0,e1,e2,e3) \ + _mm512_set4_epi64(e3,e2,e1,e0) + +#define _mm512_setr4_pd(e0,e1,e2,e3) \ + _mm512_set4_pd(e3,e2,e1,e0) + +#define _mm512_setr4_ps(e0,e1,e2,e3) \ + _mm512_set4_ps(e3,e2,e1,e0) + static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_broadcastsd_pd(__m128d __X) { Index: cfe/trunk/test/CodeGen/avx512f-builtins.c =================================================================== --- cfe/trunk/test/CodeGen/avx512f-builtins.c +++ cfe/trunk/test/CodeGen/avx512f-builtins.c @@ -6236,6 +6236,62 @@ return _mm512_set1_epi16(d); } +__m512i test_mm512_set4_epi32 (int __A, int __B, int __C, int __D) +{ + // CHECK-LABEL: @test_mm512_set4_epi32 + // CHECK: insertelement <16 x i32> {{.*}}, i32 15 + return _mm512_set4_epi32 (__A,__B,__C,__D); +} + +__m512i test_mm512_set4_epi64 (long long __A, long long __B, long long __C, long long __D) +{ + // CHECK-LABEL: @test_mm512_set4_epi64 + // CHECK: insertelement <8 x i64> {{.*}}, i32 7 + return _mm512_set4_epi64 (__A,__B,__C,__D); +} + +__m512d test_mm512_set4_pd (double __A, double __B, double __C, double __D) +{ + // CHECK-LABEL: @test_mm512_set4_pd + // CHECK: insertelement <8 x double> {{.*}}, i32 7 + return _mm512_set4_pd (__A,__B,__C,__D); +} + +__m512 test_mm512_set4_ps (float __A, float __B, float __C, float __D) +{ + // CHECK-LABEL: @test_mm512_set4_ps + // CHECK: insertelement <16 x float> {{.*}}, i32 15 + return _mm512_set4_ps (__A,__B,__C,__D); +} + +__m512i test_mm512_setr4_epi32(int e0, int e1, int e2, int e3) +{ + // CHECK-LABEL: @test_mm512_setr4_epi32 + // CHECK: insertelement <16 x i32> {{.*}}, i32 15 + return _mm512_setr4_epi32(e0, e1, e2, e3); +} + + __m512i test_mm512_setr4_epi64(long long e0, long long e1, long long e2, long long e3) +{ + // CHECK-LABEL: @test_mm512_setr4_epi64 + // CHECK: insertelement <8 x i64> {{.*}}, i32 7 + return _mm512_setr4_epi64(e0, e1, e2, e3); +} + +__m512i test_mm512_setr4_pd(double e0, double e1, double e2, double e3) +{ + // CHECK-LABEL: @test_mm512_setr4_pd + // CHECK: insertelement <8 x double> {{.*}}, i32 7 + return _mm512_setr4_pd(e0,e1,e2,e3); +} + + __m512i test_mm512_setr4_ps(float e0, float e1, float e2, float e3) +{ + // CHECK-LABEL: @test_mm512_setr4_ps + // CHECK: insertelement <16 x float> {{.*}}, i32 15 + return _mm512_setr4_ps(e0,e1,e2,e3); +} + __m512d test_mm512_castpd256_pd512(__m256d a) { // CHECK-LABEL: @test_mm512_castpd256_pd512