Index: lib/Headers/avx512fintrin.h =================================================================== --- lib/Headers/avx512fintrin.h +++ lib/Headers/avx512fintrin.h @@ -2382,6 +2382,24 @@ (__mmask16)(A), \ _MM_FROUND_CUR_DIRECTION); }) +#define _mm512_mask_roundscale_round_ps( __A, __B, __C, __imm, __R) __extension__ ({ \ + (__m512)__builtin_ia32_rndscaleps_mask ((__v16sf)( __C), (int)__imm,\ + (__v16sf)( __A),\ + (__mmask16)( __B),(int) __R);\ +}) + +#define _mm512_maskz_roundscale_round_ps( __A, __B, __imm,__R) __extension__ ({ \ + (__m512)__builtin_ia32_rndscaleps_mask ((__v16sf)( __B), (int)__imm,\ + (__v16sf)_mm512_setzero_ps (),\ + (__mmask16)( __A),(int) __R);\ +}) + +#define _mm512_roundscale_round_ps( __A, __imm, __R) __extension__ ({ \ + (__m512)__builtin_ia32_rndscaleps_mask ((__v16sf)( __A),(int) __imm,\ + (__v16sf) _mm512_undefined_ps (),\ + (__mmask16) -1,(int) __R);\ +}) + #define _mm512_roundscale_pd(A, B) __extension__ ({ \ (__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(__m512d)(A), (int)(B), \ (__v8df)(__m512d)(A), (__mmask8)-1, \ @@ -2398,6 +2416,24 @@ (__mmask8)(A), \ _MM_FROUND_CUR_DIRECTION); }) +#define _mm512_mask_roundscale_round_pd( __A, __B, __C, __imm ,__R) __extension__ ({ \ + (__m512d)__builtin_ia32_rndscalepd_mask ((__v8df)( __C),(int)__imm,\ + (__v8df)( __A),\ + (__mmask8)( __B),(int)__R);\ +}) + +#define _mm512_maskz_roundscale_round_pd( __A, __B, __imm, __R) __extension__ ({ \ + (__m512d)__builtin_ia32_rndscalepd_mask ((__v8df)( __B),(int)__imm,\ + (__v8df)_mm512_setzero_pd (),\ + (__mmask8)( __A),(int) __R);\ +}) + +#define _mm512_roundscale_round_pd( __A, __imm , __R) __extension__ ({ \ + (__m512d)__builtin_ia32_rndscalepd_mask ((__v8df)( __A),(int) __imm,\ + (__v8df)_mm512_undefined_pd (),\ + (__mmask8) -1,(int) __R);\ +}) + #define _mm512_fmadd_round_pd(A, B, C, R) __extension__ ({ \ (__m512d)__builtin_ia32_vfmaddpd512_mask((__v8df)(__m512d)(A), \ (__v8df)(__m512d)(B), \ Index: test/CodeGen/avx512f-builtins.c =================================================================== --- test/CodeGen/avx512f-builtins.c +++ test/CodeGen/avx512f-builtins.c @@ -6653,6 +6653,27 @@ return _mm512_maskz_roundscale_ps(__U,__A, 1); } +__m512 test_mm512_mask_roundscale_round_ps(__m512 __A,__mmask16 __U,__m512 __C) +{ + // CHECK-LABEL: @test_mm512_mask_roundscale_round_ps + // CHECK: @llvm.x86.avx512.mask.rndscale.ps.512 + return _mm512_mask_roundscale_round_ps(__A,__U,__C,3,_MM_FROUND_CUR_DIRECTION); +} + +__m512 test_mm512_maskz_roundscale_round_ps(__m512 __A,__mmask16 __U) +{ + // CHECK-LABEL: @test_mm512_maskz_roundscale_round_ps + // CHECK: @llvm.x86.avx512.mask.rndscale.ps.512 + return _mm512_maskz_roundscale_round_ps(__U,__A,3,_MM_FROUND_CUR_DIRECTION); +} + +__m512 test_mm512_roundscale_round_ps(__m512 __A) +{ + // CHECK-LABEL: @test_mm512_roundscale_round_ps + // CHECK: @llvm.x86.avx512.mask.rndscale.ps.512 + return _mm512_roundscale_round_ps(__A,3,_MM_FROUND_CUR_DIRECTION); +} + __m512d test_mm512_mask_roundscale_pd(__m512d __W, __mmask8 __U, __m512d __A) { // CHECK-LABEL: @test_mm512_mask_roundscale_pd @@ -6667,6 +6688,27 @@ return _mm512_maskz_roundscale_pd(__U,__A, 1); } +__m512d test_mm512_mask_roundscale_round_pd(__m512d __A,__mmask8 __U,__m512d __C) +{ + // CHECK-LABEL: @test_mm512_mask_roundscale_round_pd + // CHECK: @llvm.x86.avx512.mask.rndscale.pd.512 + return _mm512_mask_roundscale_round_pd(__A,__U,__C,3,_MM_FROUND_CUR_DIRECTION); +} + +__m512d test_mm512_maskz_roundscale_round_pd(__m512d __A,__mmask8 __U) +{ + // CHECK-LABEL: @test_mm512_maskz_roundscale_round_pd + // CHECK: @llvm.x86.avx512.mask.rndscale.pd.512 + return _mm512_maskz_roundscale_round_pd(__U,__A,3,_MM_FROUND_CUR_DIRECTION); +} + +__m512d test_mm512_roundscale_round_pd(__m512d __A) +{ + // CHECK-LABEL: @test_mm512_roundscale_round_pd + // CHECK: @llvm.x86.avx512.mask.rndscale.pd.512 + return _mm512_roundscale_round_pd(__A,3,_MM_FROUND_CUR_DIRECTION); +} + __m512i test_mm512_mask_max_epi32 (__m512i __W, __mmask16 __M, __m512i __A, __m512i __B) { // CHECK-LABEL: @test_mm512_mask_max_epi32