Bug 1647920 - Part 3: Transpile Math.trunc in Warp. r=iain

Differential Revision: https://phabricator.services.mozilla.com/D80992
This commit is contained in:
caroline 2020-06-25 23:10:20 +00:00
parent beacd1a290
commit 61b38f0a41
2 changed files with 12 additions and 1 deletions

View File

@ -931,7 +931,7 @@
- name: MathTruncToInt32Result
shared: true
transpile: false
transpile: true
args:
input: NumberId

View File

@ -1304,6 +1304,17 @@ bool WarpCacheIRTranspiler::emitMathCeilToInt32Result(NumberOperandId inputId) {
return true;
}
bool WarpCacheIRTranspiler::emitMathTruncToInt32Result(
NumberOperandId inputId) {
MDefinition* input = getOperand(inputId);
auto* ins = MTrunc::New(alloc(), input);
add(ins);
pushResult(ins);
return true;
}
bool WarpCacheIRTranspiler::emitMathRoundToInt32Result(
NumberOperandId inputId) {
MDefinition* input = getOperand(inputId);