зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1345427: Effectively change output type of MNearbyInt when specializing to float32; r=h4writer
MozReview-Commit-ID: 7u50g0wgwyB --HG-- extra : rebase_source : c51c7f0ee26196a78fb60094c2aba25fe19bfb72 extra : amend_source : 1d859b2498531e77d386ed26ce11c51aedbaa3d7
This commit is contained in:
Родитель
ff280be102
Коммит
13c9c7567f
|
@ -304,6 +304,32 @@ function refuseTrigo() {
|
|||
}
|
||||
test(refuseTrigo);
|
||||
|
||||
function acceptCeil() {
|
||||
// Specialize for floating-point output.
|
||||
f32[0] = NaN;
|
||||
f32[1] = Infinity;
|
||||
f32[2] = -0;
|
||||
f32[3] = 0.5;
|
||||
|
||||
var res = Math.ceil(f32[0]);
|
||||
f32[0] = res;
|
||||
assertFloat32(res, true);
|
||||
}
|
||||
test(acceptCeil);
|
||||
|
||||
function acceptFloor() {
|
||||
// Specialize for floating-point output.
|
||||
f32[0] = NaN;
|
||||
f32[1] = Infinity;
|
||||
f32[2] = -0;
|
||||
f32[3] = 0.5;
|
||||
|
||||
var res = Math.floor(f32[0]);
|
||||
f32[0] = res;
|
||||
assertFloat32(res, true);
|
||||
}
|
||||
test(acceptFloor);
|
||||
|
||||
function refuseMath() {
|
||||
var res = Math.log10(f32[0]);
|
||||
f32[0] = res;
|
||||
|
|
|
@ -2169,8 +2169,10 @@ MRound::trySpecializeFloat32(TempAllocator& alloc)
|
|||
void
|
||||
MNearbyInt::trySpecializeFloat32(TempAllocator& alloc)
|
||||
{
|
||||
if (EnsureFloatInputOrConvert(this, alloc))
|
||||
if (EnsureFloatInputOrConvert(this, alloc)) {
|
||||
specialization_ = MIRType::Float32;
|
||||
setResultType(MIRType::Float32);
|
||||
}
|
||||
}
|
||||
|
||||
MTableSwitch*
|
||||
|
|
Загрузка…
Ссылка в новой задаче