Bug 1638586 - Transpile Math.abs in Warp. r=iain

Differential Revision: https://phabricator.services.mozilla.com/D75692
This commit is contained in:
Tom Schuster 2020-05-17 18:59:46 +00:00
Родитель eb3f650269
Коммит 2f3233a446
2 изменённых файлов: 22 добавлений и 2 удалений

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

@ -658,13 +658,13 @@
- name: MathAbsInt32Result
shared: true
transpile: false
transpile: true
args:
input: Int32Id
- name: MathAbsNumberResult
shared: true
transpile: false
transpile: true
args:
input: NumberId

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

@ -942,6 +942,26 @@ bool WarpCacheIRTranspiler::emitCompareStringResult(JSOp op,
return emitCompareResult(op, lhsId, rhsId, MCompare::Compare_String);
}
bool WarpCacheIRTranspiler::emitMathAbsInt32Result(Int32OperandId inputId) {
MDefinition* input = getOperand(inputId);
auto* ins = MAbs::New(alloc(), input, MIRType::Int32);
add(ins);
pushResult(ins);
return true;
}
bool WarpCacheIRTranspiler::emitMathAbsNumberResult(NumberOperandId inputId) {
MDefinition* input = getOperand(inputId);
auto* ins = MAbs::New(alloc(), input, MIRType::Double);
add(ins);
pushResult(ins);
return true;
}
bool WarpCacheIRTranspiler::emitLoadArgumentFixedSlot(ValOperandId resultId,
uint8_t slotIndex) {
// Reverse of GetIndexOfArgument specialized to !hasArgumentArray.