Closed
Bug 361312
Opened 18 years ago
Closed 18 years ago
difference output on tamarin avmplus executable between Mac and Windows when running Math.pow(Infinity,-1)
Categories
(Tamarin Graveyard :: Virtual Machine, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: dschaffe, Unassigned)
Details
Attachments
(4 files)
95 bytes,
text/plain
|
Details | |
149 bytes,
application/octet-stream
|
Details | |
5.12 KB,
patch
|
stejohns
:
review+
|
Details | Diff | Splinter Review |
3.61 KB,
patch
|
wsharp
:
review+
|
Details | Diff | Splinter Review |
There are 5 failing testcases on mac on the compliance tests. The reason is the following code differs between mac and windows. print(Math.pow(Infinity,-1)); print(Math.pow(-Infinity,-1)); print(Math.pow(-Infinity,-2)); Windows Output: NaN NaN NaN Mac Output: 0 0 0 the pow.abc code is attached to this bug.
Reporter | ||
Comment 1•18 years ago
|
||
Reporter | ||
Comment 2•18 years ago
|
||
Comment 3•18 years ago
|
||
See http://lxr.mozilla.org/mozilla/source/js/src/jsmath.c#301 or so: #if !JS_USE_FDLIBM_MATH /* * Because C99 and ECMA specify different behavior for pow(), * we need to wrap the libm call to make it ECMA compliant. */ if (!JSDOUBLE_IS_FINITE(y) && (x == 1.0 || x == -1.0)) { *rval = DOUBLE_TO_JSVAL(cx->runtime->jsNaN); return JS_TRUE; } /* pow(x, +-0) is always 1, even for x = NaN. */ if (y == 0) { *rval = JSVAL_ONE; return JS_TRUE; } #endif /be
Reporter | ||
Comment 4•18 years ago
|
||
yeah, the expected behavior should be: pow(Infinity,-1)=0 so tamarin windows is wrong and tamarin mac is correct. I will update the 5 failing testcases to expect = 0 tested on JavaScript 1.7 (mozilla/js) and it is correct.
Comment 5•18 years ago
|
||
1. MathUtils.cpp change to fix Math.pow edge cases 2. AvmCore.cpp change to fix interpreted mode comparison of negative zero and zero (or other theoretical cases where an integer value ends up in a double atom type) 3. 64-bit fix for GCHiddenPointer 4. Some CodegenMIR.cpp optimizations for int/uint operations with mult/add/sub operators. If result is int/uint and inputs are int/uint, we can safely do integer math instead of promoting to double all the time.
Attachment #247710 -
Flags: review?(stejohns)
Updated•18 years ago
|
Attachment #247710 -
Flags: review?(stejohns) → review+
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 6•18 years ago
|
||
patch for mozilla/js/tamarin/test/ecma3/Math/e15_8_2_13.as fixes 5 failing Windows testcases Math.pow(Infinity,-1)=0
Attachment #247730 -
Flags: review?
Updated•18 years ago
|
Attachment #247730 -
Flags: review? → review+
Comment 7•17 years ago
|
||
Transfer Bug from Core->Tamarin to Tamarin Product.
Component: Tamarin → Virtual Machine
Product: Core → Tamarin
Version: Trunk → unspecified
Updated•15 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•