Closed
Bug 788166
Opened 12 years ago
Closed 12 years ago
IonMonkey: Always use int32 addition for (int32 + int32)|0
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: jandem, Assigned: jandem)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [ion:p2])
The md5 benchmark in bug 621203 has the following safe_add function:
function safe_add(x, y) {
return ((x|0) + (y|0))|0;
}
If the add overflowed in the interpreter, Ion uses a double addition with a bunch of int32 <-> double conversions. Type analysis could easily detect this case and respecialize the MAdd as int32.
Emscripten/Mandreel also use (int32 + int32)|0 a lot so this may help there too.
Comment 1•12 years ago
|
||
Ooh, good find!
Comment 2•12 years ago
|
||
Note that &-1 is used in some cases (Mandreel for example), so would be nice to optimize that too.
Updated•12 years ago
|
Whiteboard: [ion:p2]
Comment 3•12 years ago
|
||
The given testcase does not generate an overflow check anymore (since changes to truncate happened)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•