Skip to content

Commit 2bf9cf4

Browse files
committed
[MERGE #943] fix bug in lowering of asm.js floor/ceil on x86 <SSE4
Merge pull request #943 from MikeHolman:asmmathhelper
2 parents c78fcf6 + 35f9a9c commit 2bf9cf4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/Backend/LowerMDShared.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8657,17 +8657,26 @@ void LowererMD::HelperCallForAsmMathBuiltin(IR::Instr* instr, IR::JnHelperMethod
86578657

86588658
IR::Opnd * argOpnd = instr->UnlinkSrc1();
86598659
IR::JnHelperMethod helperMethod;
8660+
uint dwordCount;
86608661
if (argOpnd->IsFloat32())
86618662
{
86628663
helperMethod = helperMethodFloat;
86638664
LoadFloatHelperArgument(instr, argOpnd);
8665+
dwordCount = 1;
86648666
}
86658667
else
86668668
{
86678669
helperMethod = helperMethodDouble;
86688670
LoadDoubleHelperArgument(instr, argOpnd);
8671+
dwordCount = 2;
86698672
}
8670-
ChangeToHelperCall(instr, helperMethod);
8673+
8674+
instr->m_opcode = Js::OpCode::CALL;
8675+
8676+
IR::HelperCallOpnd *helperCallOpnd = Lowerer::CreateHelperCallOpnd(helperMethod, this->lowererMDArch.GetHelperArgsCount(), m_func);
8677+
instr->SetSrc1(helperCallOpnd);
8678+
8679+
this->lowererMDArch.LowerCall(instr, dwordCount);
86718680
}
86728681
void LowererMD::GenerateFastInlineBuiltInCall(IR::Instr* instr, IR::JnHelperMethod helperMethod)
86738682
{

lib/Backend/amd64/LowererMDArch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,7 @@ LowererMDArch::LowerCallPut(IR::Instr *callInstr)
793793
IR::Instr *
794794
LowererMDArch::LowerCall(IR::Instr * callInstr, uint32 argCount)
795795
{
796+
UNREFERENCED_PARAMETER(argCount);
796797
IR::Instr *retInstr = callInstr;
797798
callInstr->m_opcode = Js::OpCode::CALL;
798799

0 commit comments

Comments
 (0)