[x64] LoadConstantXmm: Don't load -0 as +0 + cleanup
This commit is contained in:
parent
f39020700a
commit
ff23b1d9f9
|
@ -801,7 +801,7 @@ void X64Emitter::LoadConstantXmm(Xbyak::Xmm dest, const vec128_t& v) {
|
||||||
if (!v.low && !v.high) {
|
if (!v.low && !v.high) {
|
||||||
// 0000...
|
// 0000...
|
||||||
vpxor(dest, dest);
|
vpxor(dest, dest);
|
||||||
} else if (v.low == ~0ull && v.high == ~0ull) {
|
} else if (v.low == ~uint64_t(0) && v.high == ~uint64_t(0)) {
|
||||||
// 1111...
|
// 1111...
|
||||||
vpcmpeqb(dest, dest);
|
vpcmpeqb(dest, dest);
|
||||||
} else {
|
} else {
|
||||||
|
@ -818,10 +818,10 @@ void X64Emitter::LoadConstantXmm(Xbyak::Xmm dest, float v) {
|
||||||
float f;
|
float f;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
} x = {v};
|
} x = {v};
|
||||||
if (!v) {
|
if (!x.i) {
|
||||||
// 0
|
// +0.0f (but not -0.0f because it may be used to flip the sign via xor).
|
||||||
vpxor(dest, dest);
|
vpxor(dest, dest);
|
||||||
} else if (x.i == ~0U) {
|
} else if (x.i == ~uint32_t(0)) {
|
||||||
// 1111...
|
// 1111...
|
||||||
vpcmpeqb(dest, dest);
|
vpcmpeqb(dest, dest);
|
||||||
} else {
|
} else {
|
||||||
|
@ -837,10 +837,10 @@ void X64Emitter::LoadConstantXmm(Xbyak::Xmm dest, double v) {
|
||||||
double d;
|
double d;
|
||||||
uint64_t i;
|
uint64_t i;
|
||||||
} x = {v};
|
} x = {v};
|
||||||
if (!v) {
|
if (!x.i) {
|
||||||
// 0
|
// +0.0 (but not -0.0 because it may be used to flip the sign via xor).
|
||||||
vpxor(dest, dest);
|
vpxor(dest, dest);
|
||||||
} else if (x.i == ~0ULL) {
|
} else if (x.i == ~uint64_t(0)) {
|
||||||
// 1111...
|
// 1111...
|
||||||
vpcmpeqb(dest, dest);
|
vpcmpeqb(dest, dest);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue