Bug 1313043 - wasm baseline: remove many ifdefs. r=h4writer

--HG--
extra : rebase_source : d2263306972a01beaa177f2b2a2234663bca62d2
This commit is contained in:
Lars T Hansen 2016-10-28 09:15:28 +02:00
Родитель b4610d54d5
Коммит 4c2510a21c
1 изменённых файлов: 103 добавлений и 301 удалений

Просмотреть файл

@ -951,7 +951,7 @@ class BaseCompiler
#endif
}
RegI64 fromI32(RegI32 r) {
RegI64 widenI32(RegI32 r) {
MOZ_ASSERT(!isAvailable(r.reg));
#ifdef JS_PUNBOX64
return RegI64(Register64(r.reg));
@ -961,6 +961,28 @@ class BaseCompiler
#endif
}
Register lowPart(RegI64 r) {
#ifdef JS_PUNBOX64
return r.reg.reg;
#else
return r.reg.low;
#endif
}
Register maybeHighPart(RegI64 r) {
#ifdef JS_PUNBOX64
return Register::Invalid();
#else
return r.reg.high;
#endif
}
void maybeClearHighPart(RegI64 r) {
#ifdef JS_NUNBOX32
masm.move32(Imm32(0), r.reg.high);
#endif
}
void freeI32(RegI32 r) {
freeGPR(r.reg);
}
@ -2463,23 +2485,27 @@ class BaseCompiler
masm.jump(&returnLabel_);
}
void subtractI64(RegI64 rhs, RegI64 srcDest) {
#if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.sub64(rhs.reg, srcDest.reg);
void pop2xI32ForIntMulDiv(RegI32* r0, RegI32* r1) {
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
// srcDest must be eax, and edx will be clobbered.
need2xI32(specific_eax, specific_edx);
*r1 = popI32();
*r0 = popI32ToSpecific(specific_eax);
freeI32(specific_edx);
#else
MOZ_CRASH("BaseCompiler platform hook: subtractI64");
pop2xI32(r0, r1);
#endif
}
void multiplyI64(RegI64 rhs, RegI64 srcDest, RegI32 temp) {
#if defined(JS_CODEGEN_X64)
MOZ_ASSERT(srcDest.reg.reg == rax);
MOZ_ASSERT(isAvailable(rdx));
masm.mul64(rhs.reg, srcDest.reg, temp.reg);
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.mul64(rhs.reg, srcDest.reg, temp.reg);
void pop2xI64ForIntDiv(RegI64* r0, RegI64* r1) {
#ifdef JS_CODEGEN_X64
// srcDest must be rax, and rdx will be clobbered.
need2xI64(specific_rax, specific_rdx);
*r1 = popI64();
*r0 = popI64ToSpecific(specific_rax);
freeI64(specific_rdx);
#else
MOZ_CRASH("BaseCompiler platform hook: multiplyI64");
pop2xI64(r0, r1);
#endif
}
@ -2599,115 +2625,29 @@ class BaseCompiler
}
#endif
void orI64(RegI64 rhs, RegI64 srcDest) {
masm.or64(rhs.reg, srcDest.reg);
}
void andI64(RegI64 rhs, RegI64 srcDest) {
#if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.and64(rhs.reg, srcDest.reg);
void pop2xI32ForShiftOrRotate(RegI32* r0, RegI32* r1) {
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
*r1 = popI32(specific_ecx);
*r0 = popI32();
#else
MOZ_CRASH("BaseCompiler platform hook: andI64");
pop2xI32(r0, r1);
#endif
}
void xorI64(RegI64 rhs, RegI64 srcDest) {
masm.xor64(rhs.reg, srcDest.reg);
void pop2xI64ForShiftOrRotate(RegI64* r0, RegI64* r1) {
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
needI32(specific_ecx);
*r1 = widenI32(specific_ecx);
*r1 = popI64ToSpecific(*r1);
*r0 = popI64();
#else
pop2xI64(r0, r1);
#endif
}
// Note, may destroy RHS too.
void lshiftI32(RegI32 rhs, RegI32 srcDest) {
void maskShiftCount32(RegI32 r) {
#if defined(JS_CODEGEN_ARM)
masm.and32(Imm32(31), rhs.reg);
#endif
masm.lshift32(rhs.reg, srcDest.reg);
}
void lshiftI64(RegI64 shift, RegI64 srcDest) {
#if defined(JS_CODEGEN_X64)
masm.lshift64(shift.reg.reg, srcDest.reg);
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.lshift64(shift.reg.low, srcDest.reg);
#else
MOZ_CRASH("BaseCompiler platform hook: lshiftI64");
#endif
}
// Note, may destroy RHS too.
void rshiftI32(RegI32 rhs, RegI32 srcDest) {
#if defined(JS_CODEGEN_ARM)
masm.and32(Imm32(31), rhs.reg);
#endif
masm.rshift32Arithmetic(rhs.reg, srcDest.reg);
}
// Note, may destroy RHS too.
void rshiftIU32(RegI32 rhs, RegI32 srcDest) {
#if defined(JS_CODEGEN_ARM)
masm.and32(Imm32(31), rhs.reg);
#endif
masm.rshift32(rhs.reg, srcDest.reg);
}
void rshiftI64(RegI64 shift, RegI64 srcDest) {
#if defined(JS_CODEGEN_X64)
masm.rshift64Arithmetic(shift.reg.reg, srcDest.reg);
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.rshift64Arithmetic(shift.reg.low, srcDest.reg);
#else
MOZ_CRASH("BaseCompiler platform hook: rshiftI64");
#endif
}
void rshiftU64(RegI64 shift, RegI64 srcDest) {
#if defined(JS_CODEGEN_X64)
masm.rshift64(shift.reg.reg, srcDest.reg);
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.rshift64(shift.reg.low, srcDest.reg);
#else
MOZ_CRASH("BaseCompiler platform hook: rshiftU64");
#endif
}
void rotateRightI64(RegI64 shift, RegI64 srcDest) {
#if defined(JS_CODEGEN_X64)
masm.rotateRight64(shift.reg.reg, srcDest.reg, srcDest.reg, Register::Invalid());
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.rotateRight64(shift.reg.low, srcDest.reg, srcDest.reg, shift.reg.high);
#else
MOZ_CRASH("BaseCompiler platform hook: rotateRightI64");
#endif
}
void rotateLeftI64(RegI64 shift, RegI64 srcDest) {
#if defined(JS_CODEGEN_X64)
masm.rotateLeft64(shift.reg.reg, srcDest.reg, srcDest.reg, Register::Invalid());
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.rotateLeft64(shift.reg.low, srcDest.reg, srcDest.reg, shift.reg.high);
#else
MOZ_CRASH("BaseCompiler platform hook: rotateLeftI64");
#endif
}
void clzI64(RegI64 srcDest) {
#if defined(JS_CODEGEN_X64)
masm.clz64(srcDest.reg, srcDest.reg.reg);
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.clz64(srcDest.reg, srcDest.reg.low);
masm.move32(Imm32(0), srcDest.reg.high);
#else
MOZ_CRASH("BaseCompiler platform hook: clzI64");
#endif
}
void ctzI64(RegI64 srcDest) {
#if defined(JS_CODEGEN_X64)
masm.ctz64(srcDest.reg, srcDest.reg.reg);
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_ARM)
masm.ctz64(srcDest.reg, srcDest.reg.low);
masm.move32(Imm32(0), srcDest.reg.high);
#else
MOZ_CRASH("BaseCompiler platform hook: ctzI64");
masm.and32(Imm32(31), r.reg);
#endif
}
@ -2721,14 +2661,6 @@ class BaseCompiler
#endif
}
void popcntI32(RegI32 srcDest, RegI32 tmp) {
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_ARM)
masm.popcnt32(srcDest.reg, srcDest.reg, tmp.reg);
#else
MOZ_CRASH("BaseCompiler platform hook: popcntI32");
#endif
}
bool popcnt64NeedsTemp() const {
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
return !AssemblerX86Shared::HasPOPCNT();
@ -2739,14 +2671,6 @@ class BaseCompiler
#endif
}
void popcntI64(RegI64 srcDest, RegI32 tmp) {
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_ARM)
masm.popcnt64(srcDest.reg, srcDest.reg, tmp.reg);
#else
MOZ_CRASH("BaseCompiler platform hook: popcntI64");
#endif
}
void reinterpretI64AsF64(RegI64 src, RegF64 dest) {
#if defined(JS_CODEGEN_X64)
masm.vmovq(src.reg.reg, dest.reg);
@ -2951,6 +2875,9 @@ class BaseCompiler
else
MOZ_CRASH("unexpected type");
#else
(void)src;
(void)isUnsigned;
(void)off;
MOZ_CRASH("BaseCompiler platform hook: OutOfLineTruncateCheckF32OrF64ToI64");
#endif
}
@ -3868,7 +3795,7 @@ BaseCompiler::emitSubtractI64()
{
RegI64 r0, r1;
pop2xI64(&r0, &r1);
subtractI64(r1, r0);
masm.sub64(r1.reg, r0.reg);
freeI64(r1);
pushI64(r0);
}
@ -3898,15 +3825,7 @@ BaseCompiler::emitMultiplyI32()
{
// TODO / OPTIMIZE: Multiplication by constant is common (bug 1275442)
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
// srcDest must be eax, and edx will be clobbered.
need2xI32(specific_eax, specific_edx);
r1 = popI32();
r0 = popI32ToSpecific(specific_eax);
freeI32(specific_edx);
#else
pop2xI32(&r0, &r1);
#endif
pop2xI32ForIntMulDiv(&r0, &r1);
masm.mul32(r1.reg, r0.reg);
freeI32(r1);
pushI32(r0);
@ -3933,7 +3852,7 @@ BaseCompiler::emitMultiplyI64()
pop2xI64(&r0, &r1);
temp = needI32();
#endif
multiplyI64(r1, r0, temp);
masm.mul64(r1.reg, r0.reg, temp.reg);
if (temp.reg != Register::Invalid())
freeI32(temp);
freeI64(r1);
@ -3965,15 +3884,7 @@ BaseCompiler::emitQuotientI32()
{
// TODO / OPTIMIZE: Fast case if lhs >= 0 and rhs is power of two.
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
// srcDest must be eax, and edx will be clobbered.
need2xI32(specific_eax, specific_edx);
r1 = popI32();
r0 = popI32ToSpecific(specific_eax);
freeI32(specific_edx);
#else
pop2xI32(&r0, &r1);
#endif
pop2xI32ForIntMulDiv(&r0, &r1);
Label done;
checkDivideByZeroI32(r1, r0, &done);
@ -3990,15 +3901,7 @@ BaseCompiler::emitQuotientU32()
{
// TODO / OPTIMIZE: Fast case if lhs >= 0 and rhs is power of two.
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
// srcDest must be eax, and edx will be clobbered.
need2xI32(specific_eax, specific_edx);
r1 = popI32();
r0 = popI32ToSpecific(specific_eax);
freeI32(specific_edx);
#else
pop2xI32(&r0, &r1);
#endif
pop2xI32ForIntMulDiv(&r0, &r1);
Label done;
checkDivideByZeroI32(r1, r0, &done);
@ -4015,15 +3918,7 @@ BaseCompiler::emitQuotientI64()
{
# ifdef JS_PUNBOX64
RegI64 r0, r1;
# ifdef JS_CODEGEN_X64
// srcDest must be rax, and rdx will be clobbered.
need2xI64(specific_rax, specific_rdx);
r1 = popI64();
r0 = popI64ToSpecific(specific_rax);
freeI64(specific_rdx);
# else
pop2xI64(&r0, &r1);
# endif
pop2xI64ForIntDiv(&r0, &r1);
quotientI64(r1, r0, IsUnsigned(false));
freeI64(r1);
pushI64(r0);
@ -4037,15 +3932,7 @@ BaseCompiler::emitQuotientU64()
{
# ifdef JS_PUNBOX64
RegI64 r0, r1;
# ifdef JS_CODEGEN_X64
// srcDest must be rax, and rdx will be clobbered.
need2xI64(specific_rax, specific_rdx);
r1 = popI64();
r0 = popI64ToSpecific(specific_rax);
freeI64(specific_rdx);
# else
pop2xI64(&r0, &r1);
# endif
pop2xI64ForIntDiv(&r0, &r1);
quotientI64(r1, r0, IsUnsigned(true));
freeI64(r1);
pushI64(r0);
@ -4060,15 +3947,7 @@ BaseCompiler::emitRemainderI32()
{
// TODO / OPTIMIZE: Fast case if lhs >= 0 and rhs is power of two.
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
// srcDest must be eax, and edx will be clobbered.
need2xI32(specific_eax, specific_edx);
r1 = popI32();
r0 = popI32ToSpecific(specific_eax);
freeI32(specific_edx);
#else
pop2xI32(&r0, &r1);
#endif
pop2xI32ForIntMulDiv(&r0, &r1);
Label done;
checkDivideByZeroI32(r1, r0, &done);
@ -4085,15 +3964,7 @@ BaseCompiler::emitRemainderU32()
{
// TODO / OPTIMIZE: Fast case if lhs >= 0 and rhs is power of two.
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
// srcDest must be eax, and edx will be clobbered.
need2xI32(specific_eax, specific_edx);
r1 = popI32();
r0 = popI32ToSpecific(specific_eax);
freeI32(specific_edx);
#else
pop2xI32(&r0, &r1);
#endif
pop2xI32ForIntMulDiv(&r0, &r1);
Label done;
checkDivideByZeroI32(r1, r0, &done);
@ -4110,14 +3981,7 @@ BaseCompiler::emitRemainderI64()
{
# ifdef JS_PUNBOX64
RegI64 r0, r1;
# ifdef JS_CODEGEN_X64
need2xI64(specific_rax, specific_rdx);
r1 = popI64();
r0 = popI64ToSpecific(specific_rax);
freeI64(specific_rdx);
# else
pop2xI64(&r0, &r1);
# endif
pop2xI64ForIntDiv(&r0, &r1);
remainderI64(r1, r0, IsUnsigned(false));
freeI64(r1);
pushI64(r0);
@ -4131,14 +3995,7 @@ BaseCompiler::emitRemainderU64()
{
# ifdef JS_PUNBOX64
RegI64 r0, r1;
# ifdef JS_CODEGEN_X64
need2xI64(specific_rax, specific_rdx);
r1 = popI64();
r0 = popI64ToSpecific(specific_rax);
freeI64(specific_rdx);
# else
pop2xI64(&r0, &r1);
# endif
pop2xI64ForIntDiv(&r0, &r1);
remainderI64(r1, r0, IsUnsigned(true));
freeI64(r1);
pushI64(r0);
@ -4320,7 +4177,7 @@ BaseCompiler::emitOrI64()
{
RegI64 r0, r1;
pop2xI64(&r0, &r1);
orI64(r1, r0);
masm.or64(r1.reg, r0.reg);
freeI64(r1);
pushI64(r0);
}
@ -4340,7 +4197,7 @@ BaseCompiler::emitAndI64()
{
RegI64 r0, r1;
pop2xI64(&r0, &r1);
andI64(r1, r0);
masm.and64(r1.reg, r0.reg);
freeI64(r1);
pushI64(r0);
}
@ -4360,7 +4217,7 @@ BaseCompiler::emitXorI64()
{
RegI64 r0, r1;
pop2xI64(&r0, &r1);
xorI64(r1, r0);
masm.xor64(r1.reg, r0.reg);
freeI64(r1);
pushI64(r0);
}
@ -4375,13 +4232,9 @@ BaseCompiler::emitShlI32()
pushI32(r);
} else {
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
r1 = popI32(specific_ecx);
r0 = popI32();
#else
pop2xI32(&r0, &r1);
#endif
lshiftI32(r1, r0);
pop2xI32ForShiftOrRotate(&r0, &r1);
maskShiftCount32(r1);
masm.lshift32(r1.reg, r0.reg);
freeI32(r1);
pushI32(r0);
}
@ -4392,15 +4245,8 @@ BaseCompiler::emitShlI64()
{
// TODO / OPTIMIZE: Constant rhs
RegI64 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
needI32(specific_ecx);
r1 = fromI32(specific_ecx);
r1 = popI64ToSpecific(r1);
r0 = popI64();
#else
pop2xI64(&r0, &r1);
#endif
lshiftI64(r1, r0);
pop2xI64ForShiftOrRotate(&r0, &r1);
masm.lshift64(lowPart(r1), r0.reg);
freeI64(r1);
pushI64(r0);
}
@ -4415,13 +4261,9 @@ BaseCompiler::emitShrI32()
pushI32(r);
} else {
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
r1 = popI32(specific_ecx);
r0 = popI32();
#else
pop2xI32(&r0, &r1);
#endif
rshiftI32(r1, r0);
pop2xI32ForShiftOrRotate(&r0, &r1);
maskShiftCount32(r1);
masm.rshift32Arithmetic(r1.reg, r0.reg);
freeI32(r1);
pushI32(r0);
}
@ -4432,15 +4274,8 @@ BaseCompiler::emitShrI64()
{
// TODO / OPTIMIZE: Constant rhs
RegI64 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
needI32(specific_ecx);
r1 = fromI32(specific_ecx);
r1 = popI64ToSpecific(r1);
r0 = popI64();
#else
pop2xI64(&r0, &r1);
#endif
rshiftI64(r1, r0);
pop2xI64ForShiftOrRotate(&r0, &r1);
masm.rshift64Arithmetic(lowPart(r1), r0.reg);
freeI64(r1);
pushI64(r0);
}
@ -4455,13 +4290,9 @@ BaseCompiler::emitShrU32()
pushI32(r);
} else {
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
r1 = popI32(specific_ecx);
r0 = popI32();
#else
pop2xI32(&r0, &r1);
#endif
rshiftIU32(r1, r0);
pop2xI32ForShiftOrRotate(&r0, &r1);
maskShiftCount32(r1);
masm.rshift32(r1.reg, r0.reg);
freeI32(r1);
pushI32(r0);
}
@ -4472,15 +4303,8 @@ BaseCompiler::emitShrU64()
{
// TODO / OPTIMIZE: Constant rhs
RegI64 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
needI32(specific_ecx);
r1 = fromI32(specific_ecx);
r1 = popI64ToSpecific(r1);
r0 = popI64();
#else
pop2xI64(&r0, &r1);
#endif
rshiftU64(r1, r0);
pop2xI64ForShiftOrRotate(&r0, &r1);
masm.rshift64(lowPart(r1), r0.reg);
freeI64(r1);
pushI64(r0);
}
@ -4490,12 +4314,7 @@ BaseCompiler::emitRotrI32()
{
// TODO / OPTIMIZE: Constant rhs
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
r1 = popI32(specific_ecx);
r0 = popI32();
#else
pop2xI32(&r0, &r1);
#endif
pop2xI32ForShiftOrRotate(&r0, &r1);
masm.rotateRight(r1.reg, r0.reg, r0.reg);
freeI32(r1);
pushI32(r0);
@ -4506,15 +4325,8 @@ BaseCompiler::emitRotrI64()
{
// TODO / OPTIMIZE: Constant rhs
RegI64 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
needI32(specific_ecx);
r1 = fromI32(specific_ecx);
r1 = popI64ToSpecific(r1);
r0 = popI64();
#else
pop2xI64(&r0, &r1);
#endif
rotateRightI64(r1, r0);
pop2xI64ForShiftOrRotate(&r0, &r1);
masm.rotateRight64(lowPart(r1), r0.reg, r0.reg, maybeHighPart(r1));
freeI64(r1);
pushI64(r0);
}
@ -4524,12 +4336,7 @@ BaseCompiler::emitRotlI32()
{
// TODO / OPTIMIZE: Constant rhs
RegI32 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
r1 = popI32(specific_ecx);
r0 = popI32();
#else
pop2xI32(&r0, &r1);
#endif
pop2xI32ForShiftOrRotate(&r0, &r1);
masm.rotateLeft(r1.reg, r0.reg, r0.reg);
freeI32(r1);
pushI32(r0);
@ -4540,15 +4347,8 @@ BaseCompiler::emitRotlI64()
{
// TODO / OPTIMIZE: Constant rhs
RegI64 r0, r1;
#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
needI32(specific_ecx);
r1 = fromI32(specific_ecx);
r1 = popI64ToSpecific(r1);
r0 = popI64();
#else
pop2xI64(&r0, &r1);
#endif
rotateLeftI64(r1, r0);
pop2xI64ForShiftOrRotate(&r0, &r1);
masm.rotateLeft64(lowPart(r1), r0.reg, r0.reg, maybeHighPart(r1));
freeI64(r1);
pushI64(r0);
}
@ -4589,7 +4389,8 @@ void
BaseCompiler::emitClzI64()
{
RegI64 r0 = popI64();
clzI64(r0);
masm.clz64(r0.reg, lowPart(r0));
maybeClearHighPart(r0);
pushI64(r0);
}
@ -4605,7 +4406,8 @@ void
BaseCompiler::emitCtzI64()
{
RegI64 r0 = popI64();
ctzI64(r0);
masm.ctz64(r0.reg, lowPart(r0));
maybeClearHighPart(r0);
pushI64(r0);
}
@ -4615,10 +4417,10 @@ BaseCompiler::emitPopcntI32()
RegI32 r0 = popI32();
if (popcnt32NeedsTemp()) {
RegI32 tmp = needI32();
popcntI32(r0, tmp);
masm.popcnt32(r0.reg, r0.reg, tmp.reg);
freeI32(tmp);
} else {
popcntI32(r0, invalidI32());
masm.popcnt32(r0.reg, r0.reg, invalidI32().reg);
}
pushI32(r0);
}
@ -4629,10 +4431,10 @@ BaseCompiler::emitPopcntI64()
RegI64 r0 = popI64();
if (popcnt64NeedsTemp()) {
RegI32 tmp = needI32();
popcntI64(r0, tmp);
masm.popcnt64(r0.reg, r0.reg, tmp.reg);
freeI32(tmp);
} else {
popcntI64(r0, invalidI32());
masm.popcnt64(r0.reg, r0.reg, invalidI32().reg);
}
pushI64(r0);
}
@ -4800,7 +4602,7 @@ BaseCompiler::emitExtendI32ToI64()
RegI64 x0 = RegI64(Register64(specific_edx.reg, specific_eax.reg));
#else
RegI32 r0 = popI32();
RegI64 x0 = fromI32(r0);
RegI64 x0 = widenI32(r0);
#endif
extendI32ToI64(r0, x0);
pushI64(x0);
@ -4811,7 +4613,7 @@ void
BaseCompiler::emitExtendU32ToI64()
{
RegI32 r0 = popI32();
RegI64 x0 = fromI32(r0);
RegI64 x0 = widenI32(r0);
extendU32ToI64(r0, x0);
pushI64(x0);
// Note: no need to free r0, since it is part of x0