diff --git a/clang/lib/Headers/avx512fintrin.h b/clang/lib/Headers/avx512fintrin.h index 701d5cf17bbd..e7b5471951cd 100644 --- a/clang/lib/Headers/avx512fintrin.h +++ b/clang/lib/Headers/avx512fintrin.h @@ -170,6 +170,8 @@ _mm512_setzero_si512(void) return (__m512i)(__v8di){ 0, 0, 0, 0, 0, 0, 0, 0 }; } +#define _mm512_setzero_epi32 _mm512_setzero_si512 + static __inline__ __m512d __DEFAULT_FN_ATTRS _mm512_undefined_pd() { @@ -274,6 +276,9 @@ _mm512_setzero_ps(void) return (__m512){ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; } + +#define _mm512_setzero _mm512_setzero_ps + static __inline __m512d __DEFAULT_FN_ATTRS _mm512_setzero_pd(void) { diff --git a/clang/test/CodeGen/avx512f-builtins.c b/clang/test/CodeGen/avx512f-builtins.c index 88092810dc63..6168fbd39ffd 100644 --- a/clang/test/CodeGen/avx512f-builtins.c +++ b/clang/test/CodeGen/avx512f-builtins.c @@ -7343,3 +7343,38 @@ __m128 test_mm_maskz_cvtsd_ss(__mmask8 __U, __m128 __A, __m128d __B) { return _mm_maskz_cvtsd_ss(__U, __A, __B); } + +__m512i test_mm512_setzero_epi32() +{ + // CHECK-LABEL: @test_mm512_setzero_epi32 + // CHECK: zeroinitializer + return _mm512_setzero_epi32(); +} + +__m512i test_mm512_setzero() +{ + // CHECK-LABEL: @test_mm512_setzero + // CHECK: zeroinitializer + return _mm512_setzero(); +} + +__m512i test_mm512_setzero_si512() +{ + // CHECK-LABEL: @test_mm512_setzero_si512 + // CHECK: zeroinitializer + return _mm512_setzero_si512(); +} + +__m512i test_mm512_setzero_ps() +{ + // CHECK-LABEL: @test_mm512_setzero_ps + // CHECK: zeroinitializer + return _mm512_setzero_ps(); +} + +__m512d test_mm512_setzero_pd() +{ + // CHECK-LABEL: @test_mm512_setzero_pd + // CHECK: zeroinitializer + return _mm512_setzero_pd(); +} \ No newline at end of file