[clang][BuiltIn][AVX512]Adding intrinsics for cmp{ss|sd} instruction set.

Differential Revision: http://reviews.llvm.org/D19601

llvm-svn: 268028
This commit is contained in:
Michael Zuckerman 2016-04-29 11:01:16 +00:00
parent 99ec00a2bb
commit 0b9d105a16
3 changed files with 102 additions and 1 deletions

View File

@ -2222,7 +2222,8 @@ TARGET_BUILTIN(__builtin_ia32_compressdf512_mask, "V8dV8dV8dUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_compressdi512_mask, "V8LLiV8LLiV8LLiUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_compresssf512_mask, "V16fV16fV16fUs","","avx512f")
TARGET_BUILTIN(__builtin_ia32_compresssi512_mask, "V16iV16iV16iUs","","avx512f")
TARGET_BUILTIN(__builtin_ia32_cmpsd_mask, "UcV2dV2dIiUcIi","","avx512f")
TARGET_BUILTIN(__builtin_ia32_cmpss_mask, "UcV4fV4fIiUcIi","","avx512f")
#undef BUILTIN
#undef TARGET_BUILTIN

View File

@ -7629,6 +7629,58 @@ _mm512_maskz_compress_epi32 (__mmask16 __U, __m512i __A)
(__mmask16) __U);
}
#define _mm_cmp_round_ss_mask( __X, __Y, __P, __R) __extension__ ({ \
__builtin_ia32_cmpss_mask ((__v4sf)( __X),\
(__v4sf)( __Y), __P,\
(__mmask8) -1, __R);\
})
#define _mm_mask_cmp_round_ss_mask( __M, __X, __Y, __P, __R) __extension__ ({ \
__builtin_ia32_cmpss_mask ((__v4sf)( __X),\
(__v4sf)( __Y), __P,\
(__mmask8)( __M), __R);\
})
#define _mm_cmp_ss_mask( __X, __Y, __P) __extension__ ({ \
__builtin_ia32_cmpss_mask ((__v4sf)( __X),\
(__v4sf)( __Y),( __P),\
(__mmask8) -1,\
_MM_FROUND_CUR_DIRECTION);\
})
#define _mm_mask_cmp_ss_mask( __M, __X, __Y, __P) __extension__ ({ \
__builtin_ia32_cmpss_mask ((__v4sf)( __X),\
(__v4sf)( __Y),( __P),\
(__mmask8)( __M),\
_MM_FROUND_CUR_DIRECTION);\
})
#define _mm_cmp_round_sd_mask( __X, __Y, __P,__R) __extension__ ({ \
__builtin_ia32_cmpsd_mask ((__v2df)( __X),\
(__v2df)( __Y), __P,\
(__mmask8) -1, __R);\
})
#define _mm_mask_cmp_round_sd_mask( __M, __X, __Y, __P, __R) __extension__ ({ \
__builtin_ia32_cmpsd_mask ((__v2df)( __X),\
(__v2df)( __Y), __P,\
(__mmask8)( __M), __R);\
})
#define _mm_cmp_sd_mask( __X, __Y, __P) __extension__ ({ \
__builtin_ia32_cmpsd_mask ((__v2df)( __X),\
(__v2df)( __Y),( __P),\
(__mmask8) -1,\
_MM_FROUND_CUR_DIRECTION);\
})
#define _mm_mask_cmp_sd_mask( __M, __X, __Y, __P) __extension__ ({ \
__builtin_ia32_cmpsd_mask ((__v2df)( __X),\
(__v2df)( __Y),( __P),\
(__mmask8)( __M),\
_MM_FROUND_CUR_DIRECTION);\
})
#undef __DEFAULT_FN_ATTRS
#endif // __AVX512FINTRIN_H

View File

@ -5285,3 +5285,51 @@ __m512i test_mm512_maskz_compress_epi32(__mmask16 __U, __m512i __A) {
// CHECK: @llvm.x86.avx512.mask.compress.d.512
return _mm512_maskz_compress_epi32(__U, __A);
}
__mmask8 test_mm_cmp_round_ss_mask(__m128 __X, __m128 __Y) {
// CHECK-LABEL: @test_mm_cmp_round_ss_mask
// CHECK: @llvm.x86.avx512.mask.cmp
return _mm_cmp_round_ss_mask(__X, __Y, 5, _MM_FROUND_CUR_DIRECTION);
}
__mmask8 test_mm_mask_cmp_round_ss_mask(__mmask8 __M, __m128 __X, __m128 __Y) {
// CHECK-LABEL: @test_mm_mask_cmp_round_ss_mask
// CHECK: @llvm.x86.avx512.mask.cmp
return _mm_mask_cmp_round_ss_mask(__M, __X, __Y, 5, _MM_FROUND_CUR_DIRECTION);
}
__mmask8 test_mm_cmp_ss_mask(__m128 __X, __m128 __Y) {
// CHECK-LABEL: @test_mm_cmp_ss_mask
// CHECK: @llvm.x86.avx512.mask.cmp
return _mm_cmp_ss_mask(__X, __Y, 5);
}
__mmask8 test_mm_mask_cmp_ss_mask(__mmask8 __M, __m128 __X, __m128 __Y) {
// CHECK-LABEL: @test_mm_mask_cmp_ss_mask
// CHECK: @llvm.x86.avx512.mask.cmp
return _mm_mask_cmp_ss_mask(__M, __X, __Y, 5);
}
__mmask8 test_mm_cmp_round_sd_mask(__m128d __X, __m128d __Y) {
// CHECK-LABEL: @test_mm_cmp_round_sd_mask
// CHECK: @llvm.x86.avx512.mask.cmp
return _mm_cmp_round_sd_mask(__X, __Y, 5, _MM_FROUND_CUR_DIRECTION);
}
__mmask8 test_mm_mask_cmp_round_sd_mask(__mmask8 __M, __m128d __X, __m128d __Y) {
// CHECK-LABEL: @test_mm_mask_cmp_round_sd_mask
// CHECK: @llvm.x86.avx512.mask.cmp
return _mm_mask_cmp_round_sd_mask(__M, __X, __Y, 5, _MM_FROUND_CUR_DIRECTION);
}
__mmask8 test_mm_cmp_sd_mask(__m128d __X, __m128d __Y) {
// CHECK-LABEL: @test_mm_cmp_sd_mask
// CHECK: @llvm.x86.avx512.mask.cmp
return _mm_cmp_sd_mask(__X, __Y, 5);
}
__mmask8 test_mm_mask_cmp_sd_mask(__mmask8 __M, __m128d __X, __m128d __Y) {
// CHECK-LABEL: @test_mm_mask_cmp_sd_mask
// CHECK: @llvm.x86.avx512.mask.cmp
return _mm_mask_cmp_sd_mask(__M, __X, __Y, 5);
}