Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
howjmay committed Jun 28, 2024
1 parent ba6d77c commit 6cd4e78
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
11 changes: 11 additions & 0 deletions sse2neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,17 @@ typedef union ALIGN_STRUCT(16) SIMDVec {
#define _MM_GET_DENORMALS_ZERO_MODE _sse2neon_mm_get_denormals_zero_mode
#define _MM_SET_DENORMALS_ZERO_MODE _sse2neon_mm_set_denormals_zero_mode

typedef union bit64_union {
double f64;
int64_t i64;
uint64_t u64;
} bit64_union;
typedef union bit32_union {
float f32;
int32_t i32;
uint32_t u32;
} bit32_union;

// Function declaration
// SSE
FORCE_INLINE unsigned int _MM_GET_ROUNDING_MODE(void);
Expand Down
25 changes: 23 additions & 2 deletions tests/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,29 @@ enum result_t {
};
extern int32_t NaN;
extern int64_t NaN64;
#define ALL_BIT_1_32 (*(float *) &NaN)
#define ALL_BIT_1_64 (*(double *) &NaN64)
float generate_all_ones_float() {
union {
uint32_t i;
float f;
} u;

u.i = UINT32_MAX; // Set all bits to 1

return u.f;
}

float generate_all_ones_double() {
union {
uint64_t i;
double f;
} u;

u.i = UINT64_MAX; // Set all bits to 1

return u.f;
}
#define ALL_BIT_1_32 generate_all_ones_float()
#define ALL_BIT_1_64 generate_all_ones_double()

template <typename T>
result_t validate128(T a, T b)
Expand Down

0 comments on commit 6cd4e78

Please sign in to comment.