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 1ebc995 commit 79827a4
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions sse2neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,16 +566,16 @@ 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 {
typedef union bit64_union_t {
double f64;
int64_t i64;
uint64_t u64;
} bit64_union;
typedef union bit32_union {
} bit64_union_t;
typedef union bit32_union_t {
float f32;
int32_t i32;
uint32_t u32;
} bit32_union;
} bit32_union_t;

// Function declaration
// SSE
Expand Down Expand Up @@ -3268,13 +3268,14 @@ FORCE_INLINE __m128d _mm_cmpge_pd(__m128d a, __m128d b)
return vreinterpretq_m128d_u64(
vcgeq_f64(vreinterpretq_f64_m128d(a), vreinterpretq_f64_m128d(b)));
#else
uint64_t a0 = (uint64_t) vget_low_u64(vreinterpretq_u64_m128d(a));
uint64_t a1 = (uint64_t) vget_high_u64(vreinterpretq_u64_m128d(a));
uint64_t b0 = (uint64_t) vget_low_u64(vreinterpretq_u64_m128d(b));
uint64_t b1 = (uint64_t) vget_high_u64(vreinterpretq_u64_m128d(b));
uint64_t d[2];
d[0] = (*(double *) &a0) >= (*(double *) &b0) ? ~UINT64_C(0) : UINT64_C(0);
d[1] = (*(double *) &a1) >= (*(double *) &b1) ? ~UINT64_C(0) : UINT64_C(0);
bit64_union_t a0, a1, b0, b1;
a0.u64 = vgetq_lane_u64(vreinterpretq_u64_m128d(a), 0);
a1.u64 = vgetq_lane_u64(vreinterpretq_u64_m128d(a), 1);
b0.u64 = vgetq_lane_u64(vreinterpretq_u64_m128d(b), 0);
b1.u64 = vgetq_lane_u64(vreinterpretq_u64_m128d(b), 1);
uint64_t d[2];
d[0] = (a0.f64) >= (b0.f64) ? ~UINT64_C(0) : UINT64_C(0);
d[1] = (a1.f64) >= (b1.f64) ? ~UINT64_C(0) : UINT64_C(0);

return vreinterpretq_m128d_u64(vld1q_u64(d));
#endif
Expand Down

0 comments on commit 79827a4

Please sign in to comment.