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 a13a8e0 commit fc79268
Showing 1 changed file with 80 additions and 63 deletions.
143 changes: 80 additions & 63 deletions tests/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3832,55 +3832,59 @@ result_t test_mm_cmpeq_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
uint64_t d0 = (_a[0] == _b[0]) ? 0xffffffffffffffff : 0;
uint64_t d1 = (_a[1] == _b[1]) ? 0xffffffffffffffff : 0;
bit64_union_t d0, d1;
d0.u64 = (_a[0] == _b[0]) ? UINT64_MAX : 0;
d1.u64 = (_a[1] == _b[1]) ? UINT64_MAX : 0;

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpeq_pd(a, b);
return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpeq_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
const uint64_t d0 = (_a[0] == _b[0]) ? ~UINT64_C(0) : 0;
const uint64_t d1 = ((const uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = (_a[0] == _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((const uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpeq_sd(a, b);

return validateDouble(c, *(const double *) &d0, *(const double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpge_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
uint64_t d0 = (_a[0] >= _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = (_a[1] >= _b[1]) ? ~UINT64_C(0) : 0;
bit64_union_t d0, d1;
d0.u64 = (_a[0] >= _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = (_a[1] >= _b[1]) ? ~UINT64_C(0) : 0;

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpge_pd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpge_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;
uint64_t d0 = (_a[0] >= _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = ((uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = (_a[0] >= _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpge_sd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpgt_epi16(const SSE2NEONTestImpl &impl, uint32_t iter)
Expand Down Expand Up @@ -3954,56 +3958,60 @@ result_t test_mm_cmpgt_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
uint64_t d0 = (_a[0] > _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = (_a[1] > _b[1]) ? ~UINT64_C(0) : 0;
bit64_union_t d0, d1;
d0.u64 = (_a[0] > _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = (_a[1] > _b[1]) ? ~UINT64_C(0) : 0;

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpgt_pd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpgt_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;
uint64_t d0 = (_a[0] > _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = ((uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = (_a[0] > _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpgt_sd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmple_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
uint64_t d0 = (_a[0] <= _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = (_a[1] <= _b[1]) ? ~UINT64_C(0) : 0;
bit64_union_t d0, d1;
d0.u64 = (_a[0] <= _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = (_a[1] <= _b[1]) ? ~UINT64_C(0) : 0;

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmple_pd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmple_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;
uint64_t d0 = (_a[0] <= _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = ((uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = (_a[0] <= _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmple_sd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmplt_epi16(const SSE2NEONTestImpl &impl, uint32_t iter)
Expand Down Expand Up @@ -4076,171 +4084,180 @@ result_t test_mm_cmplt_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;

int64_t f0 = (_a[0] < _b[0]) ? ~UINT64_C(0) : UINT64_C(0);
int64_t f1 = (_a[1] < _b[1]) ? ~UINT64_C(0) : UINT64_C(0);
bit64_union_t d0, d1;
d0.u64 = (_a[0] < _b[0]) ? ~UINT64_C(0) : UINT64_C(0);
d1.u64 = (_a[1] < _b[1]) ? ~UINT64_C(0) : UINT64_C(0);

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmplt_pd(a, b);

return validateDouble(c, *(double *) &f0, *(double *) &f1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmplt_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;
uint64_t d0 = (_a[0] < _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = ((uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = (_a[0] < _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmplt_sd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpneq_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;

int64_t f0 = (_a[0] != _b[0]) ? ~UINT64_C(0) : UINT64_C(0);
int64_t f1 = (_a[1] != _b[1]) ? ~UINT64_C(0) : UINT64_C(0);
bit64_union_t d0, d1;
d0.u64 = (_a[0] != _b[0]) ? ~UINT64_C(0) : UINT64_C(0);
d1.u64 = (_a[1] != _b[1]) ? ~UINT64_C(0) : UINT64_C(0);

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpneq_pd(a, b);

return validateDouble(c, *(double *) &f0, *(double *) &f1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpneq_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;

int64_t f0 = (_a[0] != _b[0]) ? ~UINT64_C(0) : UINT64_C(0);
int64_t f1 = ((int64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = (_a[0] != _b[0]) ? ~UINT64_C(0) : UINT64_C(0);
d1.u64 = ((int64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpneq_sd(a, b);

return validateDouble(c, *(double *) &f0, *(double *) &f1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpnge_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
uint64_t d0 = !(_a[0] >= _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = !(_a[1] >= _b[1]) ? ~UINT64_C(0) : 0;
bit64_union_t d0, d1;
d0.u64 = !(_a[0] >= _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = !(_a[1] >= _b[1]) ? ~UINT64_C(0) : 0;

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpnge_pd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpnge_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;
uint64_t d0 = !(_a[0] >= _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = ((uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = !(_a[0] >= _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpnge_sd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpngt_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
uint64_t d0 = !(_a[0] > _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = !(_a[1] > _b[1]) ? ~UINT64_C(0) : 0;
bit64_union_t d0, d1;
d0.u64 = !(_a[0] > _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = !(_a[1] > _b[1]) ? ~UINT64_C(0) : 0;

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpngt_pd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpngt_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;
uint64_t d0 = !(_a[0] > _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = ((uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = !(_a[0] > _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpngt_sd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpnle_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
uint64_t d0 = !(_a[0] <= _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = !(_a[1] <= _b[1]) ? ~UINT64_C(0) : 0;
bit64_union_t d0, d1;
d0.u64 = !(_a[0] <= _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = !(_a[1] <= _b[1]) ? ~UINT64_C(0) : 0;

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpnle_pd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpnle_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;
uint64_t d0 = !(_a[0] <= _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = ((uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = !(_a[0] <= _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpnle_sd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpnlt_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
const double *_a = (const double *) impl.mTestFloatPointer1;
const double *_b = (const double *) impl.mTestFloatPointer2;
uint64_t d0 = !(_a[0] < _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = !(_a[1] < _b[1]) ? ~UINT64_C(0) : 0;
bit64_union_t d0, d1;
d0.u64 = !(_a[0] < _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = !(_a[1] < _b[1]) ? ~UINT64_C(0) : 0;

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpnlt_pd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpnlt_sd(const SSE2NEONTestImpl &impl, uint32_t iter)
{
double *_a = (double *) impl.mTestFloatPointer1;
double *_b = (double *) impl.mTestFloatPointer2;
uint64_t d0 = !(_a[0] < _b[0]) ? ~UINT64_C(0) : 0;
uint64_t d1 = ((uint64_t *) _a)[1];
bit64_union_t d0, d1;
d0.u64 = !(_a[0] < _b[0]) ? ~UINT64_C(0) : 0;
d1.u64 = ((uint64_t *) _a)[1];

__m128d a = load_m128d(_a);
__m128d b = load_m128d(_b);
__m128d c = _mm_cmpnlt_sd(a, b);

return validateDouble(c, *(double *) &d0, *(double *) &d1);
return validateDouble(c, d0.f64, d1.f64);
}

result_t test_mm_cmpord_pd(const SSE2NEONTestImpl &impl, uint32_t iter)
Expand Down

0 comments on commit fc79268

Please sign in to comment.