File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
crates/intrinsic-test/src/x86 Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -320,10 +320,9 @@ pub const PLATFORM_C_FORWARD_DECLARATIONS: &str = r#"
320
320
#define _mm256_loadu_epi64_to___m256(mem_addr) _mm256_castsi256_ps(_mm256_loadu_si256((__m256i const*)(mem_addr)))
321
321
#define _mm512_loadu_epi64_to___m512(mem_addr) _mm512_castsi512_ps(_mm512_loadu_si512((__m512i const*)(mem_addr)))
322
322
323
-
324
323
// T1 is the `To` type, T2 is the `From` type
325
324
template<typename T1, typename T2> T1 cast(T2 x) {
326
- if constexpr (std::is_convertible_v<T2, T1>) {
325
+ if constexpr (( std::is_integral_v<T1> && std::is_integral_v<T2>) || (std::is_floating_point_v< T1> && std::is_floating_point_v<T2>) ) {
327
326
return x;
328
327
} else if constexpr (sizeof(T1) == sizeof(T2)) {
329
328
T1 ret{};
You can’t perform that action at this time.
0 commit comments