Closed Bug 704437 Opened 13 years ago Closed 6 years ago

Test issue: run-time vs. compile-time evaluation in Float and Float4 tests

Categories

(Tamarin Graveyard :: Baseline JIT (CodegenLIR), defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX
Q2 12 - Cyril

People

(Reporter: wmaddox, Unassigned)

References

Details

The following test case revealed an error in constant folding for unary
negation of float4 values.  The error was actually found by inspection,
and it was with some fussing around that I produced the test case.  In
particular, using -Ojit did not allow folding of the negations in the
top-level script.  Examination of the acceptance suite suggests that we have
not systematically attempted to control for whether compile-time evaluation
would take place, meaning that in some cases, we are likely testing either
the run-time or the compile-time case and leaving a hole in coverage.

// Test sign of unary negation of Float4

var flt4:float4;

function neg1():float4 { 
   var f4:float4 = new float4(0f);
   return -f4; // folded
}
trace(1/neg1());

flt4 = new float4(0f);
flt4 = -flt4;  // not folded
trace(1/flt4);

function neg2():float4 { 
   var f4:float4 = new float4(-0f);
   return -f4;  // folded
}
trace(1/neg2());

flt4 = new float4(-0f);
flt4 = -flt4; // not folded
trace(1/flt4);
Blocks: float/float4
Out of curiosity, does the "new" make any difference here?  It should not - float4(x) is the same as new float4(x) in all contexts; the canonical expression is the former.

Also, if x is constant then ASC is required to turn either expression into a pushfloat4, basically, though it will not perform the folding of negate for "var" bindings, only for "const" bindings.
Flags: in-testsuite?
Flags: flashplayer-triage+
Flags: flashplayer-qrb+
Flags: flashplayer-bug-
(In reply to Lars T Hansen from comment #1)
> Out of curiosity, does the "new" make any difference here?  It should not -
> float4(x) is the same as new float4(x) in all contexts; the canonical
> expression is the former.

I used the 'new float4()' form simply because the test case was derived from
one of the acceptance tests that did so: as3/Types/Float4/op_negate.as .
Priority: -- → P3
Target Milestone: --- → Q2 12 - Cyril
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.