Commit e01d9d31 authored by Blue Swirl's avatar Blue Swirl
Browse files

x86: fix coding style in ops_sse.h



Fix coding style in ops_sse.h before next commit.
Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
parent 9dd69d65
......@@ -203,12 +203,15 @@ void glue(helper_psrldq, SUFFIX)(Reg *d, Reg *s)
int shift, i;
shift = s->L(0);
if (shift > 16)
if (shift > 16) {
shift = 16;
for(i = 0; i < 16 - shift; i++)
}
for (i = 0; i < 16 - shift; i++) {
d->B(i) = d->B(i + shift);
for(i = 16 - shift; i < 16; i++)
}
for (i = 16 - shift; i < 16; i++) {
d->B(i) = 0;
}
}
void glue(helper_pslldq, SUFFIX)(Reg *d, Reg *s)
......@@ -216,112 +219,119 @@ void glue(helper_pslldq, SUFFIX)(Reg *d, Reg *s)
int shift, i;
shift = s->L(0);
if (shift > 16)
if (shift > 16) {
shift = 16;
for(i = 15; i >= shift; i--)
}
for (i = 15; i >= shift; i--) {
d->B(i) = d->B(i - shift);
for(i = 0; i < shift; i++)
}
for (i = 0; i < shift; i++) {
d->B(i) = 0;
}
}
#endif
#define SSE_HELPER_B(name, F)\
void glue(name, SUFFIX) (Reg *d, Reg *s)\
{\
d->B(0) = F(d->B(0), s->B(0));\
d->B(1) = F(d->B(1), s->B(1));\
d->B(2) = F(d->B(2), s->B(2));\
d->B(3) = F(d->B(3), s->B(3));\
d->B(4) = F(d->B(4), s->B(4));\
d->B(5) = F(d->B(5), s->B(5));\
d->B(6) = F(d->B(6), s->B(6));\
d->B(7) = F(d->B(7), s->B(7));\
XMM_ONLY(\
d->B(8) = F(d->B(8), s->B(8));\
d->B(9) = F(d->B(9), s->B(9));\
d->B(10) = F(d->B(10), s->B(10));\
d->B(11) = F(d->B(11), s->B(11));\
d->B(12) = F(d->B(12), s->B(12));\
d->B(13) = F(d->B(13), s->B(13));\
d->B(14) = F(d->B(14), s->B(14));\
d->B(15) = F(d->B(15), s->B(15));\
)\
}
#define SSE_HELPER_W(name, F)\
void glue(name, SUFFIX) (Reg *d, Reg *s)\
{\
d->W(0) = F(d->W(0), s->W(0));\
d->W(1) = F(d->W(1), s->W(1));\
d->W(2) = F(d->W(2), s->W(2));\
d->W(3) = F(d->W(3), s->W(3));\
XMM_ONLY(\
d->W(4) = F(d->W(4), s->W(4));\
d->W(5) = F(d->W(5), s->W(5));\
d->W(6) = F(d->W(6), s->W(6));\
d->W(7) = F(d->W(7), s->W(7));\
)\
}
#define SSE_HELPER_L(name, F)\
void glue(name, SUFFIX) (Reg *d, Reg *s)\
{\
d->L(0) = F(d->L(0), s->L(0));\
d->L(1) = F(d->L(1), s->L(1));\
XMM_ONLY(\
d->L(2) = F(d->L(2), s->L(2));\
d->L(3) = F(d->L(3), s->L(3));\
)\
}
#define SSE_HELPER_Q(name, F)\
void glue(name, SUFFIX) (Reg *d, Reg *s)\
{\
d->Q(0) = F(d->Q(0), s->Q(0));\
XMM_ONLY(\
d->Q(1) = F(d->Q(1), s->Q(1));\
)\
}
#define SSE_HELPER_B(name, F) \
void glue(name, SUFFIX)(Reg *d, Reg *s) \
{ \
d->B(0) = F(d->B(0), s->B(0)); \
d->B(1) = F(d->B(1), s->B(1)); \
d->B(2) = F(d->B(2), s->B(2)); \
d->B(3) = F(d->B(3), s->B(3)); \
d->B(4) = F(d->B(4), s->B(4)); \
d->B(5) = F(d->B(5), s->B(5)); \
d->B(6) = F(d->B(6), s->B(6)); \
d->B(7) = F(d->B(7), s->B(7)); \
XMM_ONLY( \
d->B(8) = F(d->B(8), s->B(8)); \
d->B(9) = F(d->B(9), s->B(9)); \
d->B(10) = F(d->B(10), s->B(10)); \
d->B(11) = F(d->B(11), s->B(11)); \
d->B(12) = F(d->B(12), s->B(12)); \
d->B(13) = F(d->B(13), s->B(13)); \
d->B(14) = F(d->B(14), s->B(14)); \
d->B(15) = F(d->B(15), s->B(15)); \
) \
}
#define SSE_HELPER_W(name, F) \
void glue(name, SUFFIX)(Reg *d, Reg *s) \
{ \
d->W(0) = F(d->W(0), s->W(0)); \
d->W(1) = F(d->W(1), s->W(1)); \
d->W(2) = F(d->W(2), s->W(2)); \
d->W(3) = F(d->W(3), s->W(3)); \
XMM_ONLY( \
d->W(4) = F(d->W(4), s->W(4)); \
d->W(5) = F(d->W(5), s->W(5)); \
d->W(6) = F(d->W(6), s->W(6)); \
d->W(7) = F(d->W(7), s->W(7)); \
) \
}
#define SSE_HELPER_L(name, F) \
void glue(name, SUFFIX)(Reg *d, Reg *s) \
{ \
d->L(0) = F(d->L(0), s->L(0)); \
d->L(1) = F(d->L(1), s->L(1)); \
XMM_ONLY( \
d->L(2) = F(d->L(2), s->L(2)); \
d->L(3) = F(d->L(3), s->L(3)); \
) \
}
#define SSE_HELPER_Q(name, F) \
void glue(name, SUFFIX)(Reg *d, Reg *s) \
{ \
d->Q(0) = F(d->Q(0), s->Q(0)); \
XMM_ONLY( \
d->Q(1) = F(d->Q(1), s->Q(1)); \
) \
}
#if SHIFT == 0
static inline int satub(int x)
{
if (x < 0)
if (x < 0) {
return 0;
else if (x > 255)
} else if (x > 255) {
return 255;
else
} else {
return x;
}
}
static inline int satuw(int x)
{
if (x < 0)
if (x < 0) {
return 0;
else if (x > 65535)
} else if (x > 65535) {
return 65535;
else
} else {
return x;
}
}
static inline int satsb(int x)
{
if (x < -128)
if (x < -128) {
return -128;
else if (x > 127)
} else if (x > 127) {
return 127;
else
} else {
return x;
}
}
static inline int satsw(int x)
{
if (x < -32768)
if (x < -32768) {
return -32768;
else if (x > 32767)
} else if (x > 32767) {
return 32767;
else
} else {
return x;
}
}
#define FADD(a, b) ((a) + (b))
......@@ -340,22 +350,22 @@ static inline int satsw(int x)
#define FMAXUB(a, b) ((a) > (b)) ? (a) : (b)
#define FMAXSW(a, b) ((int16_t)(a) > (int16_t)(b)) ? (a) : (b)
#define FAND(a, b) (a) & (b)
#define FAND(a, b) ((a) & (b))
#define FANDN(a, b) ((~(a)) & (b))
#define FOR(a, b) (a) | (b)
#define FXOR(a, b) (a) ^ (b)
#define FOR(a, b) ((a) | (b))
#define FXOR(a, b) ((a) ^ (b))
#define FCMPGTB(a, b) (int8_t)(a) > (int8_t)(b) ? -1 : 0
#define FCMPGTW(a, b) (int16_t)(a) > (int16_t)(b) ? -1 : 0
#define FCMPGTL(a, b) (int32_t)(a) > (int32_t)(b) ? -1 : 0
#define FCMPEQ(a, b) (a) == (b) ? -1 : 0
#define FCMPGTB(a, b) ((int8_t)(a) > (int8_t)(b) ? -1 : 0)
#define FCMPGTW(a, b) ((int16_t)(a) > (int16_t)(b) ? -1 : 0)
#define FCMPGTL(a, b) ((int32_t)(a) > (int32_t)(b) ? -1 : 0)
#define FCMPEQ(a, b) ((a) == (b) ? -1 : 0)
#define FMULLW(a, b) (a) * (b)
#define FMULHRW(a, b) ((int16_t)(a) * (int16_t)(b) + 0x8000) >> 16
#define FMULHUW(a, b) (a) * (b) >> 16
#define FMULHW(a, b) (int16_t)(a) * (int16_t)(b) >> 16
#define FMULLW(a, b) ((a) * (b))
#define FMULHRW(a, b) (((int16_t)(a) * (int16_t)(b) + 0x8000) >> 16)
#define FMULHUW(a, b) ((a) * (b) >> 16)
#define FMULHW(a, b) ((int16_t)(a) * (int16_t)(b) >> 16)
#define FAVG(a, b) ((a) + (b) + 1) >> 1
#define FAVG(a, b) (((a) + (b) + 1) >> 1)
#endif
SSE_HELPER_B(helper_paddb, FADD)
......@@ -407,7 +417,7 @@ SSE_HELPER_W(helper_pmulhw, FMULHW)
SSE_HELPER_B(helper_pavgb, FAVG)
SSE_HELPER_W(helper_pavgw, FAVG)
void glue(helper_pmuludq, SUFFIX) (Reg *d, Reg *s)
void glue(helper_pmuludq, SUFFIX)(Reg *d, Reg *s)
{
d->Q(0) = (uint64_t)s->L(0) * (uint64_t)d->L(0);
#if SHIFT == 1
......@@ -415,26 +425,27 @@ void glue(helper_pmuludq, SUFFIX) (Reg *d, Reg *s)
#endif
}
void glue(helper_pmaddwd, SUFFIX) (Reg *d, Reg *s)
void glue(helper_pmaddwd, SUFFIX)(Reg *d, Reg *s)
{
int i;
for(i = 0; i < (2 << SHIFT); i++) {
d->L(i) = (int16_t)s->W(2*i) * (int16_t)d->W(2*i) +
(int16_t)s->W(2*i+1) * (int16_t)d->W(2*i+1);
for (i = 0; i < (2 << SHIFT); i++) {
d->L(i) = (int16_t)s->W(2 * i) * (int16_t)d->W(2 * i) +
(int16_t)s->W(2 * i + 1) * (int16_t)d->W(2 * i + 1);
}
}
#if SHIFT == 0
static inline int abs1(int a)
{
if (a < 0)
if (a < 0) {
return -a;
else
} else {
return a;
}
}
#endif
void glue(helper_psadbw, SUFFIX) (Reg *d, Reg *s)
void glue(helper_psadbw, SUFFIX)(Reg *d, Reg *s)
{
unsigned int val;
......@@ -462,16 +473,18 @@ void glue(helper_psadbw, SUFFIX) (Reg *d, Reg *s)
#endif
}
void glue(helper_maskmov, SUFFIX) (Reg *d, Reg *s, target_ulong a0)
void glue(helper_maskmov, SUFFIX)(Reg *d, Reg *s, target_ulong a0)
{
int i;
for(i = 0; i < (8 << SHIFT); i++) {
if (s->B(i) & 0x80)
for (i = 0; i < (8 << SHIFT); i++) {
if (s->B(i) & 0x80) {
stb(a0 + i, d->B(i));
}
}
}
void glue(helper_movl_mm_T0, SUFFIX) (Reg *d, uint32_t val)
void glue(helper_movl_mm_T0, SUFFIX)(Reg *d, uint32_t val)
{
d->L(0) = val;
d->L(1) = 0;
......@@ -481,7 +494,7 @@ void glue(helper_movl_mm_T0, SUFFIX) (Reg *d, uint32_t val)
}
#ifdef TARGET_X86_64
void glue(helper_movq_mm_T0, SUFFIX) (Reg *d, uint64_t val)
void glue(helper_movq_mm_T0, SUFFIX)(Reg *d, uint64_t val)
{
d->Q(0) = val;
#if SHIFT == 1
......@@ -491,9 +504,10 @@ void glue(helper_movq_mm_T0, SUFFIX) (Reg *d, uint64_t val)
#endif
#if SHIFT == 0
void glue(helper_pshufw, SUFFIX) (Reg *d, Reg *s, int order)
void glue(helper_pshufw, SUFFIX)(Reg *d, Reg *s, int order)
{
Reg r;
r.W(0) = s->W(order & 3);
r.W(1) = s->W((order >> 2) & 3);
r.W(2) = s->W((order >> 4) & 3);
......@@ -504,6 +518,7 @@ void glue(helper_pshufw, SUFFIX) (Reg *d, Reg *s, int order)
void helper_shufps(Reg *d, Reg *s, int order)
{
Reg r;
r.L(0) = d->L(order & 3);
r.L(1) = d->L((order >> 2) & 3);
r.L(2) = s->L((order >> 4) & 3);
......@@ -514,14 +529,16 @@ void helper_shufps(Reg *d, Reg *s, int order)
void helper_shufpd(Reg *d, Reg *s, int order)
{
Reg r;
r.Q(0) = d->Q(order & 1);
r.Q(1) = s->Q((order >> 1) & 1);
*d = r;
}
void glue(helper_pshufd, SUFFIX) (Reg *d, Reg *s, int order)
void glue(helper_pshufd, SUFFIX)(Reg *d, Reg *s, int order)
{
Reg r;
r.L(0) = s->L(order & 3);
r.L(1) = s->L((order >> 2) & 3);
r.L(2) = s->L((order >> 4) & 3);
......@@ -529,9 +546,10 @@ void glue(helper_pshufd, SUFFIX) (Reg *d, Reg *s, int order)
*d = r;
}
void glue(helper_pshuflw, SUFFIX) (Reg *d, Reg *s, int order)
void glue(helper_pshuflw, SUFFIX)(Reg *d, Reg *s, int order)
{
Reg r;
r.W(0) = s->W(order & 3);
r.W(1) = s->W((order >> 2) & 3);
r.W(2) = s->W((order >> 4) & 3);
......@@ -540,9 +558,10 @@ void glue(helper_pshuflw, SUFFIX) (Reg *d, Reg *s, int order)
*d = r;
}
void glue(helper_pshufhw, SUFFIX) (Reg *d, Reg *s, int order)
void glue(helper_pshufhw, SUFFIX)(Reg *d, Reg *s, int order)
{
Reg r;
r.Q(0) = s->Q(0);
r.W(4) = s->W(4 + (order & 3));
r.W(5) = s->W(4 + ((order >> 2) & 3));
......@@ -556,29 +575,30 @@ void glue(helper_pshufhw, SUFFIX) (Reg *d, Reg *s, int order)
/* FPU ops */
/* XXX: not accurate */
#define SSE_HELPER_S(name, F)\
void helper_ ## name ## ps (Reg *d, Reg *s)\
{\
d->XMM_S(0) = F(32, d->XMM_S(0), s->XMM_S(0));\
d->XMM_S(1) = F(32, d->XMM_S(1), s->XMM_S(1));\
d->XMM_S(2) = F(32, d->XMM_S(2), s->XMM_S(2));\
d->XMM_S(3) = F(32, d->XMM_S(3), s->XMM_S(3));\
}\
\
void helper_ ## name ## ss (Reg *d, Reg *s)\
{\
d->XMM_S(0) = F(32, d->XMM_S(0), s->XMM_S(0));\
}\
void helper_ ## name ## pd (Reg *d, Reg *s)\
{\
d->XMM_D(0) = F(64, d->XMM_D(0), s->XMM_D(0));\
d->XMM_D(1) = F(64, d->XMM_D(1), s->XMM_D(1));\
}\
\
void helper_ ## name ## sd (Reg *d, Reg *s)\
{\
d->XMM_D(0) = F(64, d->XMM_D(0), s->XMM_D(0));\
}
#define SSE_HELPER_S(name, F) \
void helper_ ## name ## ps(Reg *d, Reg *s) \
{ \
d->XMM_S(0) = F(32, d->XMM_S(0), s->XMM_S(0)); \
d->XMM_S(1) = F(32, d->XMM_S(1), s->XMM_S(1)); \
d->XMM_S(2) = F(32, d->XMM_S(2), s->XMM_S(2)); \
d->XMM_S(3) = F(32, d->XMM_S(3), s->XMM_S(3)); \
} \
\
void helper_ ## name ## ss(Reg *d, Reg *s) \
{ \
d->XMM_S(0) = F(32, d->XMM_S(0), s->XMM_S(0)); \
} \
\
void helper_ ## name ## pd(Reg *d, Reg *s) \
{ \
d->XMM_D(0) = F(64, d->XMM_D(0), s->XMM_D(0)); \
d->XMM_D(1) = F(64, d->XMM_D(1), s->XMM_D(1)); \
} \
\
void helper_ ## name ## sd(Reg *d, Reg *s) \
{ \
d->XMM_D(0) = F(64, d->XMM_D(0), s->XMM_D(0)); \
}
#define FPU_ADD(size, a, b) float ## size ## _add(a, b, &env->sse_status)
#define FPU_SUB(size, a, b) float ## size ## _sub(a, b, &env->sse_status)
......@@ -590,8 +610,10 @@ void helper_ ## name ## sd (Reg *d, Reg *s)\
* special cases right: for min and max Intel specifies that (-0,0),
* (NaN, anything) and (anything, NaN) return the second argument.
*/
#define FPU_MIN(size, a, b) float ## size ## _lt(a, b, &env->sse_status) ? (a) : (b)
#define FPU_MAX(size, a, b) float ## size ## _lt(b, a, &env->sse_status) ? (a) : (b)
#define FPU_MIN(size, a, b) \
(float ## size ## _lt(a, b, &env->sse_status) ? (a) : (b))
#define FPU_MAX(size, a, b) \
(float ## size ## _lt(b, a, &env->sse_status) ? (a) : (b))
SSE_HELPER_S(add, FPU_ADD)
SSE_HELPER_S(sub, FPU_SUB)
......@@ -606,6 +628,7 @@ SSE_HELPER_S(sqrt, FPU_SQRT)
void helper_cvtps2pd(Reg *d, Reg *s)
{
float32 s0, s1;
s0 = s->XMM_S(0);
s1 = s->XMM_S(1);
d->XMM_D(0) = float32_to_float64(s0, &env->sse_status);
......@@ -641,6 +664,7 @@ void helper_cvtdq2ps(Reg *d, Reg *s)
void helper_cvtdq2pd(Reg *d, Reg *s)
{
int32_t l0, l1;
l0 = (int32_t)s->XMM_L(0);
l1 = (int32_t)s->XMM_L(1);
d->XMM_D(0) = int32_to_float64(l0, &env->sse_status);
......@@ -864,6 +888,7 @@ void helper_insertq_i(XMMReg *d, int index, int length)
void helper_haddps(XMMReg *d, XMMReg *s)
{
XMMReg r;
r.XMM_S(0) = float32_add(d->XMM_S(0), d->XMM_S(1), &env->sse_status);
r.XMM_S(1) = float32_add(d->XMM_S(2), d->XMM_S(3), &env->sse_status);
r.XMM_S(2) = float32_add(s->XMM_S(0), s->XMM_S(1), &env->sse_status);
......@@ -874,6 +899,7 @@ void helper_haddps(XMMReg *d, XMMReg *s)
void helper_haddpd(XMMReg *d, XMMReg *s)
{
XMMReg r;
r.XMM_D(0) = float64_add(d->XMM_D(0), d->XMM_D(1), &env->sse_status);
r.XMM_D(1) = float64_add(s->XMM_D(0), s->XMM_D(1), &env->sse_status);
*d = r;
......@@ -882,6 +908,7 @@ void helper_haddpd(XMMReg *d, XMMReg *s)
void helper_hsubps(XMMReg *d, XMMReg *s)
{
XMMReg r;
r.XMM_S(0) = float32_sub(d->XMM_S(0), d->XMM_S(1), &env->sse_status);
r.XMM_S(1) = float32_sub(d->XMM_S(2), d->XMM_S(3), &env->sse_status);
r.XMM_S(2) = float32_sub(s->XMM_S(0), s->XMM_S(1), &env->sse_status);
......@@ -892,6 +919,7 @@ void helper_hsubps(XMMReg *d, XMMReg *s)
void helper_hsubpd(XMMReg *d, XMMReg *s)
{
XMMReg r;
r.XMM_D(0) = float64_sub(d->XMM_D(0), d->XMM_D(1), &env->sse_status);
r.XMM_D(1) = float64_sub(s->XMM_D(0), s->XMM_D(1), &env->sse_status);
*d = r;
......@@ -912,38 +940,47 @@ void helper_addsubpd(XMMReg *d, XMMReg *s)
}
/* XXX: unordered */
#define SSE_HELPER_CMP(name, F)\
void helper_ ## name ## ps (Reg *d, Reg *s)\
{\
d->XMM_L(0) = F(32, d->XMM_S(0), s->XMM_S(0));\
d->XMM_L(1) = F(32, d->XMM_S(1), s->XMM_S(1));\
d->XMM_L(2) = F(32, d->XMM_S(2), s->XMM_S(2));\
d->XMM_L(3) = F(32, d->XMM_S(3), s->XMM_S(3));\
}\
\
void helper_ ## name ## ss (Reg *d, Reg *s)\
{\
d->XMM_L(0) = F(32, d->XMM_S(0), s->XMM_S(0));\
}\
void helper_ ## name ## pd (Reg *d, Reg *s)\
{\
d->XMM_Q(0) = F(64, d->XMM_D(0), s->XMM_D(0));\
d->XMM_Q(1) = F(64, d->XMM_D(1), s->XMM_D(1));\
}\
\
void helper_ ## name ## sd (Reg *d, Reg *s)\
{\
d->XMM_Q(0) = F(64, d->XMM_D(0), s->XMM_D(0));\
}
#define FPU_CMPEQ(size, a, b) float ## size ## _eq_quiet(a, b, &env->sse_status) ? -1 : 0
#define FPU_CMPLT(size, a, b) float ## size ## _lt(a, b, &env->sse_status) ? -1 : 0
#define FPU_CMPLE(size, a, b) float ## size ## _le(a, b, &env->sse_status) ? -1 : 0
#define FPU_CMPUNORD(size, a, b) float ## size ## _unordered_quiet(a, b, &env->sse_status) ? - 1 : 0
#define FPU_CMPNEQ(size, a, b) float ## size ## _eq_quiet(a, b, &env->sse_status) ? 0 : -1
#define FPU_CMPNLT(size, a, b) float ## size ## _lt(a, b, &env->sse_status) ? 0 : -1
#define FPU_CMPNLE(size, a, b) float ## size ## _le(a, b, &env->sse_status) ? 0 : -1
#define FPU_CMPORD(size, a, b) float ## size ## _unordered_quiet(a, b, &env->sse_status) ? 0 : -1
#define SSE_HELPER_CMP(name, F) \
void helper_ ## name ## ps(Reg *d, Reg *s) \
{ \
d->XMM_L(0) = F(32, d->XMM_S(0), s->XMM_S(0)); \
d->XMM_L(1) = F(32, d->XMM_S(1), s->XMM_S(1)); \
d->XMM_L(2) = F(32, d->XMM_S(2), s->XMM_S(2)); \
d->XMM_L(3) = F(32, d->XMM_S(3), s->XMM_S(3)); \
} \
\
void helper_ ## name ## ss(Reg *d, Reg *s) \
{ \
d->XMM_L(0) = F(32, d->XMM_S(0), s->XMM_S(0)); \
} \
\
void helper_ ## name ## pd(Reg *d, Reg *s) \
{ \
d->XMM_Q(0) = F(64, d->XMM_D(0), s->XMM_D(0)); \
d->XMM_Q(1) = F(64, d->XMM_D(1), s->XMM_D(1)); \
} \
\
void helper_ ## name ## sd(Reg *d, Reg *s) \
{ \
d->XMM_Q(0) = F(64, d->XMM_D(0), s->XMM_D(0)); \
}
#define FPU_CMPEQ(size, a, b) \
(float ## size ## _eq_quiet(a, b, &env->sse_status) ? -1 : 0)
#define FPU_CMPLT(size, a, b) \
(float ## size ## _lt(a, b, &env->sse_status) ? -1 : 0)
#define FPU_CMPLE(size, a, b) \
(float ## size ## _le(a, b, &env->sse_status) ? -1 : 0)
#define FPU_CMPUNORD(size, a, b) \
(float ## size ## _unordered_quiet(a, b, &env->sse_status) ? -1 : 0)
#define FPU_CMPNEQ(size, a, b) \
(float ## size ## _eq_quiet(a, b, &env->sse_status) ? 0 : -1)
#define FPU_CMPNLT(size, a, b) \
(float ## size ## _lt(a, b, &env->sse_status) ? 0 : -1)
#define FPU_CMPNLE(size, a, b) \
(float ## size ## _le(a, b, &env->sse_status) ? 0 : -1)
#define FPU_CMPORD(size, a, b) \
(float ## size ## _unordered_quiet(a, b, &env->sse_status) ? 0 : -1)
SSE_HELPER_CMP(cmpeq, FPU_CMPEQ)
SSE_HELPER_CMP(cmplt, FPU_CMPLT)
......@@ -1003,6 +1040,7 @@ void helper_comisd(Reg *d, Reg *s)
uint32_t helper_movmskps(Reg *s)
{
int b0, b1, b2, b3;
b0 = s->XMM_L(0) >> 31;
b1 = s->XMM_L(1) >> 31;
b2 = s->XMM_L(2) >> 31;
......@@ -1013,6 +1051,7 @@ uint32_t helper_movmskps(Reg *s)
uint32_t helper_movmskpd(Reg *s)
{
int b0, b1;
b0 = s->XMM_L(1) >> 31;
b1 = s->XMM_L(3) >> 31;
return b0 | (b1 << 1);
......@@ -1023,6 +1062,7 @@ uint32_t helper_movmskpd(Reg *s)
uint32_t glue(helper_pmovmskb, SUFFIX)(Reg *s)
{
uint32_t val;
val = 0;
val |= (s->B(0) >> 7);
val |= (s->B(1) >> 6) & 0x02;
......@@ -1045,7 +1085,7 @@ uint32_t glue(helper_pmovmskb, SUFFIX)(Reg *s)
return val;
}
void glue(helper_packsswb, SUFFIX) (Reg *d, Reg *s)
void glue(helper_packsswb, SUFFIX)(Reg *d, Reg *s)
{
Reg r;
......@@ -1072,7 +1112,7 @@ void glue(helper_packsswb, SUFFIX) (Reg *d, Reg *s)
*d = r;
}
void glue(helper_packuswb, SUFFIX) (Reg *d, Reg *s)
void glue(helper_packuswb, SUFFIX)(Reg *d, Reg *s)
{
Reg r;
......@@ -1099,7 +1139,7 @@ void glue(helper_packuswb, SUFFIX) (Reg *d, Reg *s)
*d = r;
}
void glue(helper_packssdw, SUFFIX) (Reg *d, Reg *s)
void glue(helper_packssdw, SUFFIX)(Reg *d, Reg *s)
{
Reg r;
......@@ -1118,73 +1158,74 @@ void glue(helper_packssdw, SUFFIX) (Reg *d, Reg *s)
*d = r;
}
#define UNPCK_OP(base_name, base) \
\
void glue(helper_punpck ## base_name ## bw, SUFFIX) (Reg *d, Reg *s) \
{ \
Reg r; \
\
r.B(0) = d->B((base << (SHIFT + 2)) + 0); \
r.B(1) = s->B((base << (SHIFT + 2)) + 0); \