Hi Zoltan.

I believe you're talking about this code for op_jfalse:

        zeroDouble(fpRegT0);
        emitLoadDouble(cond, fpRegT1);
        addJump(branchDouble(DoubleEqual, fpRegT0, fpRegT1), target);

and this code for op_jtrue:

        zeroDouble(fpRegT0);
        emitLoadDouble(cond, fpRegT1);
addJump(branchDouble(DoubleNotEqual, fpRegT0, fpRegT1), target);

The goal of this code is to perform a comparison that distinguishes { 0, NaN } from all other doubles. op_jfalse should branch in the case of 0 or NaN, and, inversely, op_jtrue should branch in all other cases.

It sounds like the equal / zero condition does not indicate NaN on all platforms. Bummer.

I'm not an expert in ARM (or other floating point processors, for that matter), so I'm not sure what the best abstraction is for this notion of "compares to zero as equal or unordered". Since IEEE double requires all comparisons to NaN to be implicitly false, I do expect that there is some efficient single branch that can do this on ARM. From http://www.heyrick.co.uk/assembler/fpops.html#cmf, it looks like "the CMF instruction should be used to test for equality (ie when a BEQ or BNE is used afterwards) or to test for unorderedness (in the V flag)."

Gavin, do you have any ideas here?

Geoff

On Oct 12, 2009, at 4:05 AM, Zoltan Herczeg wrote:

Hi,

My stougle with USE_JSVALUE32_64 still continues on ARM. In
emit_op_jfalse, there is a comparison here (fpRegT0 contains 0.0):
addJump(branchDouble(DoubleEqual, fpRegT0, fpRegT1), target + 2);

In x86, if either operand is NaN, the zero flag is set by definition
(ucomisd instruction). I have no idea why (NaN == anything is true?).
Unfortunately, ARM does not set the zero flag. What would be a portable way to improve this instruction? (and emit_op_jtrue) Perhaps this affects
the possible thumb2 implementation with USE_JSVALUE32_64 as well.

Zoltan


_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to